home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / C / DIALOG.ZIP / DBPRO1-@.COM / DBPRO.TXT < prev   
Encoding:
Text File  |  1989-09-08  |  291.4 KB  |  5,413 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                     The DialogPro
  8.                                            
  9.                 *  * * * *  Users Guide and Reference Manual * * * * *
  10.                                            
  11.                                    by Kenneth Stott
  12.                                      version 2.1
  13.                                            
  14.                                            
  15.                                            
  16.                                            
  17.                                            
  18.                                            
  19.                                            
  20.                                            
  21.                                            
  22.                                            
  23.                                   Seabreeze Software
  24.                                     908 Route 518
  25.                               Skillman, New Jersey 08558
  26.                                     (609) 924-6793
  27.                                            
  28.                                            
  29.                                            
  30.                                            
  31.                                            
  32.                        Copyright (c) 1987-1989 by Kenneth Stott
  33.                                  All Rights Reserved
  34.                                            
  35.                                            
  36.                                            
  37.                                            
  38.                                            
  39.                                            
  40.                                            
  41.                                            
  42.                                            
  43.           The DialogPro shareware diskette, containing a copy of this
  44.           manual, may be freely copied and shared.  But, printed copies of
  45.           this document may not be copied by any method without the express
  46.           written permission of Seabreeze Software.
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.           DialogPro v 2.1                                       Users Guide
  71.                                                            Reference Manual
  72.  
  73.  
  74.           I.    Introduction . . . . . . . . . . . . . . . . . . . . .    1
  75.           II.   Overview . . . . . . . . . . . . . . . . . . . . . . .    3
  76.           III.  Technical Notes  . . . . . . . . . . . . . . . . . . .    6
  77.           IV.   Shareware  . . . . . . . . . . . . . . . . . . . . . .   12
  78.           V.    Registration . . . . . . . . . . . . . . . . . . . . .   13
  79.           VI.   Support Details  . . . . . . . . . . . . . . . . . . .   15
  80.           VII.  Diskette . . . . . . . . . . . . . . . . . . . . . . .   16
  81.           VIII. Installation . . . . . . . . . . . . . . . . . . . . .   18
  82.           IX.   Compiling and linking the demo . . . . . . . . . . . .   19
  83.           X.    DialogPro Reference  . . . . . . . . . . . . . . . . .   20
  84.              A. Introduction . . . . . . . . . . . . . . . . . . . . .   20
  85.              B. Functions  . . . . . . . . . . . . . . . . . . . . . .   21
  86.                 1.  db_display . . . . . . . . . . . . . . . . . . . .   21
  87.                 2.  db_displayq  . . . . . . . . . . . . . . . . . . .   21
  88.                 3.  db_flushqueue  . . . . . . . . . . . . . . . . . .   22
  89.                 4.  db_freestorage . . . . . . . . . . . . . . . . . .   22
  90.                 5.  db_pop . . . . . . . . . . . . . . . . . . . . . .   23
  91.                 6.  db_priority  . . . . . . . . . . . . . . . . . . .   23
  92.                 7.  db_push  . . . . . . . . . . . . . . . . . . . . .   23
  93.                 8.  db_restoreanswers  . . . . . . . . . . . . . . . .   24
  94.                 9.  db_run . . . . . . . . . . . . . . . . . . . . . .   24
  95.                 10. db_selectq . . . . . . . . . . . . . . . . . . . .   26
  96.                 11. db_storeanswers  . . . . . . . . . . . . . . . . .   27
  97.                 12. db_switchqueue . . . . . . . . . . . . . . . . . .   28
  98.                 13. lst_display  . . . . . . . . . . . . . . . . . . .   29
  99.                 14. lst_displayitem  . . . . . . . . . . . . . . . . .   30
  100.                 15. lst_freestorage  . . . . . . . . . . . . . . . . .   31
  101.                 16. lst_restoreanswers . . . . . . . . . . . . . . . .   31
  102.                 17. lst_run  . . . . . . . . . . . . . . . . . . . . .   32
  103.                 18. lst_select . . . . . . . . . . . . . . . . . . . .   34
  104.                 19. lst_storeanswers . . . . . . . . . . . . . . . . .   34
  105.                 20. lst_toggle . . . . . . . . . . . . . . . . . . . .   35
  106.              C. Standard Return Values . . . . . . . . . . . . . . . .   36
  107.              D. Data structures  . . . . . . . . . . . . . . . . . . .   37
  108.                 1.  button . . . . . . . . . . . . . . . . . . . . . .   37
  109.                 2.  db_colors  . . . . . . . . . . . . . . . . . . . .   38
  110.                 3.  db_delimiters  . . . . . . . . . . . . . . . . . .   39
  111.                 4.  dialog_box . . . . . . . . . . . . . . . . . . . .   40
  112.                 5.  free_form  . . . . . . . . . . . . . . . . . . . .   43
  113.                 6.  list . . . . . . . . . . . . . . . . . . . . . . .   44
  114.                 7.  list_rec . . . . . . . . . . . . . . . . . . . . .   47
  115.                 8.  multi_choice . . . . . . . . . . . . . . . . . . .   50
  116.                 9.  rcbutton . . . . . . . . . . . . . . . . . . . . .   52
  117.                 10. reducer  . . . . . . . . . . . . . . . . . . . . .   53
  118.                 11. scroll_txt . . . . . . . . . . . . . . . . . . . .   55
  119.                 12. title  . . . . . . . . . . . . . . . . . . . . . .   57
  120.              E. Global variables . . . . . . . . . . . . . . . . . . .   58
  121.                 1. db_head, db_tail, db_queue  . . . . . . . . . . . .   58
  122.                 2. default_db_cmds . . . . . . . . . . . . . . . . . .   58
  123.                 3. idle  . . . . . . . . . . . . . . . . . . . . . . .   58
  124.                 4. monitor_switch, _fg, _bg, _speed, _wdw, _tile . . .   58
  125.                 5. mouse_sensitivity . . . . . . . . . . . . . . . . .   59
  126.              F. Messages . . . . . . . . . . . . . . . . . . . . . . .   60
  127.                 1. Dialog Box  . . . . . . . . . . . . . . . . . . . .   60
  128.  
  129.  
  130.  
  131.                                         - 1 -
  132.  
  133.  
  134.  
  135.  
  136.  
  137.           DialogPro v 2.1                                       Users Guide
  138.                                                            Reference Manual
  139.  
  140.  
  141.                 2. Line Editor . . . . . . . . . . . . . . . . . . . .   63
  142.                 3. list question . . . . . . . . . . . . . . . . . . .   65
  143.                 4. Pull down list  . . . . . . . . . . . . . . . . . .   66
  144.           XI.   Resource Files Reference . . . . . . . . . . . . . . .   67
  145.              A. Introduction . . . . . . . . . . . . . . . . . . . . .   67
  146.              B. Creating Resource Files  . . . . . . . . . . . . . . .   67
  147.                 1. Introduction  . . . . . . . . . . . . . . . . . . .   67
  148.                 2. ID record . . . . . . . . . . . . . . . . . . . . .   68
  149.                 3. Window record . . . . . . . . . . . . . . . . . . .   68
  150.                 4. Text Literal records  . . . . . . . . . . . . . . .   69
  151.                 5. Question records  . . . . . . . . . . . . . . . . .   69
  152.                    a. Introduction . . . . . . . . . . . . . . . . . .   69
  153.                    b. Radio Button records . . . . . . . . . . . . . .   69
  154.                    c. Checkbox records . . . . . . . . . . . . . . . .   70
  155.                    d. Free Form records  . . . . . . . . . . . . . . .   70
  156.                    e. Button records . . . . . . . . . . . . . . . . .   71
  157.                    f. List records . . . . . . . . . . . . . . . . . .   72
  158.                    g. Multiple Choice records  . . . . . . . . . . . .   72
  159.                    h. Pulldown record  . . . . . . . . . . . . . . . .   73
  160.                 6. Terminator record . . . . . . . . . . . . . . . . .   73
  161.              C. Testing Resource Files . . . . . . . . . . . . . . . .   73
  162.              D. Incorporating Resource Files into your programs  . . .   74
  163.              E. Embedding Resource Files . . . . . . . . . . . . . . .   76
  164.              F. Functions  . . . . . . . . . . . . . . . . . . . . . .   77
  165.                 1. create_db . . . . . . . . . . . . . . . . . . . . .   77
  166.                 2. destroy_db  . . . . . . . . . . . . . . . . . . . .   77
  167.           XII.  HypeIt!  . . . . . . . . . . . . . . . . . . . . . . .   78
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.                                         - 2 -
  199.  
  200.  
  201.  
  202.  
  203.  
  204.           DialogPro v 2.1                                       Users Guide
  205.                                                            Reference Manual
  206.  
  207.  
  208.           I.    Introduction
  209.           
  210.           The DialogPro will help you implement one of today's hottest user
  211.           interface analogies, the dialog box.  The dialog box, popularized
  212.           by Apple, is now a mainstay in almost all modern PC based
  213.           software.  And it is here to stay.  Despite not being invented by
  214.           IBM, it is included in their latest SAA user interface standards.
  215.           
  216.           If you don't already know, The dialog box is a pop-up window with
  217.           a form inside of it.  The form consists principally of questions,
  218.           these questions can be checklists, multiple choice questions
  219.           (sometimes known as radio buttons,) scrolling lists, and
  220.           buttons.  Buttons are special because they can indicate to
  221.           perform some sort of action.  Typically the action will be
  222.           something like, confirm the answers to the other questions, or
  223.           abort the dialog box (restore the old answers and return to the
  224.           previous process.)  The dialog box is a familiar sight to most
  225.           personal computer users and is a tremendously simple way to get a
  226.           solid, consistent, user interface into your applications.
  227.           
  228.           The bad news is that dialog boxes, while making life easier for
  229.           the user, are difficult to implement.  This is particularly true
  230.           in a mouse environment -- where a user can literally click (or
  231.           point, or press, or drag, etc., etc.) on any thing he sees on the
  232.           screen -- how do you deal with that in a traditional structured
  233.           programming style?  
  234.           
  235.           The answer is you don't have to, at least not directly.  Most
  236.           programmers work in a competitive, cost conscious environment and
  237.           don't have the time to ponder messaging and object orientation. 
  238.           The DialogPro lets you use the latest techniques, without
  239.           sweating the details.  It lets you put the latest, most
  240.           professional, Microsoftish/Borlandish/Macontish interface on your
  241.           programs without the pain.  Your users will be able to hang onto
  242.           to their mice and learn your programs faster (even if you don't
  243.           get it -- A lot people have fallen in love with the mouse.)  And
  244.           you'll be relieved of a big part of the programming, the
  245.           training, and the support.
  246.           
  247.           The DialogPro is tremendously flexible.  Every dialog box
  248.           understands over 60 commands -- you program these commands to any
  249.           keystrokes you like.  Create additional commands, hot-keys, etc.
  250.           by defining macro-commands and attaching them to keystrokes. 
  251.           Automatically update target variables in your applications. 
  252.           "Hook" in your own routines directly into dialog box questions. 
  253.           Perform edit checking and field updating/formatting on the fly,
  254.           anything you can imagine.
  255.           
  256.           There are just so many uses for the DialogPro that it is hard to
  257.           list them all here.  But things like interreferenced help systems
  258.           a la Lotus 1-2-3 are pretty straight forward.  Likewise, creating
  259.           a user interface that conforms to SAA standards would be easy. 
  260.           The DialogPro is perfect for desktop oriented applications
  261.           because at the heart of the DialogPro are sophisticated,
  262.  
  263.  
  264.  
  265.                                         - 1 -
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           DialogPro v 2.1                                       Users Guide
  272.                                                            Reference Manual
  273.  
  274.  
  275.           object-oriented, messaging algorithms.  But the DialogPro is just
  276.           as comfortable sprucing up existing programs because the
  277.           sophistication is literally "at the heart" of The DialogPro;
  278.           ready to be put to use when you need it--but ingeniously "hidden"
  279.           until you want it.  And that really is the key to The
  280.           DialogPro--it gives you what YOU want, adapts to your style.
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.                                         - 2 -
  333.  
  334.  
  335.  
  336.  
  337.  
  338.           DialogPro v 2.1                                       Users Guide
  339.                                                            Reference Manual
  340.  
  341.  
  342.           II.   Overview
  343.           
  344.           The user sees a dialog box like this.  A form to fill in.  A
  345.           dynamic form where lists can scroll, amounts fill in
  346.           automatically, and buttons can be pushed to continue or perform
  347.           other actions.
  348.           
  349.               +[  Personal Information  ]-----------------+
  350.               |                                           |
  351.               |  Name : _________________________________ |
  352.               |  Street : _______________________________ |
  353.               |  City : _________________________________ |
  354.               |  State : __   Zip Code __________________ |
  355.               |                                           |
  356.               |  Occupation :    +----------------------+ |        
  357.               |                  |[ ] Doctor           ^^ |
  358.               |  +=========+     |[ ] Dentist          || |
  359.               |  | Confirm |     |[ ] Lawyer           || |
  360.               |  +=========+     |[ ] Accountant       oo |
  361.               |  +---------+     |[ ] Mechanic         || |
  362.               |  |  Abort  |     |[ ] Engineer         vv |
  363.               |  +---------+     +----------------------- |
  364.               +-------------------------------------------+
  365.           
  366.           The programmer sees this as a hierarchical data structure.  The
  367.           dialog box is a structure with a series of subordinate data
  368.           structures representing the various questions, buttons, and
  369.           lists.  As the programmer your principal task is to create these
  370.           data structures.  The db_run and db_display functions are then
  371.           used to execute and/or display the dialog boxes.
  372.           
  373.           In the above example your would first define a dialog box
  374.           structure.  You would then define free_form (or
  375.           fill-in-the-blank) structures for the Name, Street, City, and Zip
  376.           Code fields.  The State field could be represented as either a
  377.           multiple choice question, a reduction question (where the user
  378.           supplies part of the answer and the dialog box attempts to
  379.           determine the correct answer or displays a list of possible
  380.           answers to select from -- like all the states that begin with M,
  381.           for example,) or it could be just another fill in the blank
  382.           question.
  383.           
  384.           Confirm and Abort would be defined as button structures and
  385.           Occupation would be a list structure.
  386.           
  387.           To see an example of how to create a simple dialog box see the
  388.           included source file, SIMPLEDB.C.
  389.           
  390.           Of course, if this were the end of the story The DialogPro
  391.           wouldn't be all that useful.  There are several default data
  392.           types to help you get started but ultimately the programmer has
  393.           final control over virtually every aspect of how a dialog box
  394.           looks and operates.  For example,
  395.           
  396.  
  397.  
  398.  
  399.                                         - 3 -
  400.  
  401.  
  402.  
  403.  
  404.  
  405.           DialogPro v 2.1                                       Users Guide
  406.                                                            Reference Manual
  407.  
  408.  
  409.             .  You can position questions anywhere in the pop-up window, or
  410.                in separate tiles of a pop up window, even create paged
  411.                dialog boxes by swapping tiles in and out.
  412.             
  413.             .  You can control how the questions are presented to the
  414.                user.  Including delimiter characters, the position of the
  415.                statement describing the question, where the response to the
  416.                question should be located, the maximum length of the
  417.                response, the color of the statement, the color of the
  418.                response, and many more aspects.
  419.             
  420.             .  You may assign target variables to questions. Target
  421.                variables are automatically updated with the responses to
  422.                questions as they are answered.
  423.             
  424.             .  You can control the order that the user navigates to the
  425.                questions.
  426.             
  427.             .  You can "hook" in pre and/or post routines to each
  428.                question.  Using the pre/post routines you can do edit
  429.                checking, field updating, even modify the user interface.
  430.             
  431.             .  You can indicate that questions are "unavailable" for
  432.                modification.  In a graphics environment this is sometimes
  433.                known as "greying" out a choice.
  434.             
  435.             .  You can extend both the mouse and keyboard interface by
  436.                creating macros to define completely new commands and
  437.                features, or combine or modify existing features.  Macros
  438.                can call your own routines or simply expand into a series of
  439.                alternative messages.  This feature alone makes the
  440.                DialogPro almost infinitely extendable.
  441.             
  442.           
  443.           Resource Files
  444.           
  445.           Fairly complex dialog boxes can be defined using dialog box
  446.           resource files.  You can define one or more dialog boxes in a
  447.           resource file and then instruct DialogPro to create a dialog box,
  448.           display or run the created dialog box, and to destroy the dialog
  449.           box.  The DialogPro allows resource files to be embedded in other
  450.           files.  For example,  you can append your resource files to your
  451.           executable file to make user install procedures simpler, to
  452.           control the files better, etc.  Resource files are the simplest
  453.           way to get access to the DialogPro.  Authoring programs are
  454.           included to help you create and test resource files.
  455.           
  456.           See the "Using Resource Files" manual for more information on
  457.           resource files.
  458.           
  459.           HypeIt!
  460.           
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                                         - 4 -
  467.  
  468.  
  469.  
  470.  
  471.  
  472.           DialogPro v 2.1                                       Users Guide
  473.                                                            Reference Manual
  474.  
  475.  
  476.           A hypertext library (hypeit) is included.  HypeIt! is a help
  477.           engine that lets you incorporate hypertext like help systems into
  478.           your programs.  It also includes authoring programs to help you
  479.           build, test, or distribute hyperdocs.  Run the program hypeit.exe
  480.           for more information on using the hypeit libs.
  481.           
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.                                         - 5 -
  534.  
  535.  
  536.  
  537.  
  538.  
  539.           DialogPro v 2.1                                       Users Guide
  540.                                                            Reference Manual
  541.  
  542.  
  543.           III.  Technical Notes
  544.           
  545.           This section describes what you'll need to use The DialogPro, any
  546.           limitations you should be aware of, and describes (in further
  547.           detail) the theory of operation.
  548.           
  549.           
  550.           The WindowPro
  551.           
  552.           The DialogPro is based on The WindowPro.  You must have The
  553.           WindowPro to use The DialogPro.  Just like The DialogPro, The
  554.           WindowPro is also available from Seabreeze Software.
  555.           
  556.           If you have The WindowPro, and it works on your machine and
  557.           compiler, then so will The DialogPro.  (Note: The DialogPro is
  558.           currently only tested with Quick-C 1.X, MSC C 5.X, and Turbo C
  559.           1.X compilers.)
  560.           
  561.           Size
  562.           
  563.           The DialogPro adds about 45K of code to your application, in
  564.           addition to requiring virtually the full WindowPro library (which
  565.           adds about another 60K.)
  566.           
  567.           
  568.           What is a dialog box?
  569.           
  570.           Dialog boxes and questions are hierarchical data structures. 
  571.           Each dialog box routine operates on a given data structure. 
  572.           Because they are data structures you can modify them, on the
  573.           fly.  In fact your pre/post routines can "grey-out" options,
  574.           update fields, and remove questions dynamically by doing just
  575.           that.  The dialog box routines interpret the data structures to
  576.           display the dialog box, select methods of dealing with user
  577.           commands, etc.  As such, the application programmers main task is
  578.           to "fill-in" these data structures properly.
  579.           
  580.           
  581.           Messages at first glance
  582.           
  583.           The major dialog box routine is db_run.  db_run handles the bulk
  584.           of the work, interpreting all messages and parceling out the work
  585.           to the lower level routines.  They each have their own keyboard
  586.           and mouse handlers so that they operate as closed systems or
  587.           black boxes.  You call the routines, they execute, put the
  588.           results into the target variables, and return to the calling
  589.           function.  The application programmer doesn't deal with message
  590.           queues, keyboards, or mice--A BLACK BOX.  
  591.           
  592.           But inside the black box keyboard and mouse handlers interpret
  593.           keyboard and mouse activity into messages.  The messages are then
  594.           placed into a queue and processed.  Despite being somewhat
  595.  
  596.  
  597.  
  598.  
  599.  
  600.                                         - 6 -
  601.  
  602.  
  603.  
  604.  
  605.  
  606.           DialogPro v 2.1                                       Users Guide
  607.                                                            Reference Manual
  608.  
  609.  
  610.           "invisible" the capability to manipulate the message queues is
  611.           there.  Manipulating messages directly can give you added
  612.           flexibility.
  613.           
  614.           
  615.           Using the KEYBOARD
  616.           
  617.           Each of the messages recognized by a dialog box (see DBOPS.H for
  618.           a complete list) can be associated with a keyboard code (a scan
  619.           code & ascii code two byte sequence.)  This keyboard interface is
  620.           represented as an array of integers where its position in the
  621.           array relates to the message value.  Any keystroke can be
  622.           assigned to any message.  The keyboard handler uses this lookup
  623.           table to redefine keystrokes into the messages which db_run
  624.           processes.
  625.           
  626.           
  627.           Using the MOUSE
  628.           
  629.           The mouse handler routines generate messages in the same way that
  630.           the keyboard handler generates dialog box messages.  Although
  631.           there is no lookup table to help you redefine the mouse
  632.           interface.  You can define macros which intercept the mouse
  633.           generated messages and redefine them.
  634.           
  635.           
  636.           Creating and Interpreting Messages
  637.           
  638.           Each data structure has an associated function to interpret
  639.           messages.  Each of these functions handles messages like this.
  640.           
  641.                1.   It takes the message passed as a parameter and puts it
  642.                     at the head of the current circular queue.
  643.           
  644.                2.   It looks for a message at the tail of the queue.
  645.           
  646.                     A.   If a message is found:
  647.                     
  648.                          a.   It first looks up the message in the macro
  649.                               list.  If the message is a macro it expands
  650.                               the macro by putting the new messages at the
  651.                               tail of the queue, and then returns to step
  652.                               2,
  653.           
  654.                          b.   Messages must have a value of less than 256. 
  655.                               If the message has a value of greater than
  656.                               256 we assume that it is an extended keyboard
  657.                               code.  The extended kyeboard code is
  658.                               intepreted into a "real" message".  The
  659.                               "real" message is placed at the tail of the
  660.                               queue,  and it then returns to step 2.
  661.                          
  662.  
  663.  
  664.  
  665.  
  666.  
  667.                                         - 7 -
  668.  
  669.  
  670.  
  671.  
  672.  
  673.           DialogPro v 2.1                                       Users Guide
  674.                                                            Reference Manual
  675.  
  676.  
  677.                          c.   If we make it past steps 2.A.a and 2.A.b we
  678.                               execute the message.  The CONFIRM, ABORT, 
  679.                               SPECIAL messages terminate db_run and return
  680.                               back to the calling function.  If the message
  681.                               is not one of the above it returns to step 2
  682.                               to get another message to execute.
  683.           
  684.                     C.   If no message is found, it polls the mouse and the
  685.                          keyboard waiting for activity.  If activity is
  686.                          found, the activity is interpreted into a message
  687.                          and put at the tail of the queue -- it then
  688.                          returns to step 2.
  689.           
  690.           
  691.           You can modify the behavior of The DialogPro by manipulating the
  692.           message queues.  Several functions are provided for putting
  693.           messages at the head and the tail, and for reading the message
  694.           queue. 
  695.           
  696.           
  697.           More Notes on Working with Dialog Boxes and Messages
  698.           
  699.           The term 'question' is roughly equivalent to the term 'control'
  700.           in MS-Windows.  'questions' are the elements which comprise a
  701.           dialog box.
  702.           
  703.           At any time any question within the dialog box may have control
  704.           of the queue (in MS-Windows this is similar to having the
  705.           focus.)  A question relinquishes control of the queue on
  706.           receiving an ASCEND, DESCEND, CONFIRM, ABORT, NEXT, or PREV
  707.           message.   Remember that the Dialog Pro sees everything as
  708.           hierarchical structures, with this in mind, the ASCEND message
  709.           gives control of the queue to the superior object, usually a
  710.           dialog box.  A DESCEND message gives control of the queue to the
  711.           current questions subordinate object, for example in a multiple
  712.           choice question this would display a pull down list and the pull
  713.           down list would then control the queue.  
  714.           
  715.           The DialogPro is similar to object oriented programming except
  716.           that 'unknown' messages are discarded instead of being implicitly
  717.           passed to the superior class for processing.  However, messages
  718.           can be, and frequently are, passed to superior objects
  719.           explicitly.  
  720.           
  721.           The basic technique for passing a message to a superior object is
  722.           to push an ASCEND and then the original message back onto the
  723.           queue. The ASCEND forces the current object to relinquish control
  724.           of the queue to the superior object.  The next message on the
  725.           queue which the superior object now receives is the original
  726.           message.  
  727.           
  728.           For example, if NEXT or PREV is received in a free_form question
  729.           it responds by pushing an ASCEND and a NEXT or PREV) onto the
  730.           queue.  The ASCEND is then taken from the queue.  This results in
  731.  
  732.  
  733.  
  734.                                         - 8 -
  735.  
  736.  
  737.  
  738.  
  739.  
  740.           DialogPro v 2.1                                       Users Guide
  741.                                                            Reference Manual
  742.  
  743.  
  744.           control of the queue passing to the dialog box.  The dialog box
  745.           takes the NEXT from the queue and handles it by selecting the
  746.           next question.
  747.           
  748.           The best way to see how messages are processed is to use the
  749.           queue monitor when creating and debugging a dialog box.
  750.           
  751.           
  752.           The Questions
  753.           
  754.           FREE_FORM
  755.           
  756.           Free form questions are used to gather one line text responses. 
  757.           The text can be up to a thousand characters long.  The response
  758.           area can be any size.  While editing, the response text scrolls
  759.           within the response area.  The line editor has home, end, word
  760.           right/left, and character right/left, backspace and delete
  761.           functions.  Clicking on any character places the cursor on the
  762.           character.
  763.           
  764.           
  765.           MULTI_CHOICE
  766.           
  767.           Multiple choice questions can be configured to operate as pull
  768.           down menus or as more traditional multiple choice questions.  The
  769.           principle difference is that the current response to a multiple
  770.           choice question is displayed in the response area.  The pulldown
  771.           menu type doesn't display the current response.
  772.           
  773.           The user cycles through the responses to a multiple choice
  774.           question with PRESS_BUTTON, or selects the next response
  775.           beginning with a specific character, or pulls down the list of
  776.           available choices with the DESCEND or EXPAND commands -- and then
  777.           selects his choice from the complete list.  With the mouse, the
  778.           user cycles through the available responses by clicking on the
  779.           response area.  He pulls down the list of available responses by
  780.           double-clicking, or holding, on the response area.
  781.           
  782.           
  783.           RADIO BUTTONS
  784.           
  785.           Radio buttons serve the same purpose as multiple choice
  786.           questions, except that all of your available choices are
  787.           displayed in the dialog box rather than just your currently
  788.           selected choice.
  789.           
  790.           
  791.           CHECKBOXES
  792.           
  793.           Checkboxes let you toggle an item on and off.
  794.           
  795.           
  796.           REDUCER
  797.           
  798.  
  799.  
  800.  
  801.                                         - 9 -
  802.  
  803.  
  804.  
  805.  
  806.  
  807.           DialogPro v 2.1                                       Users Guide
  808.                                                            Reference Manual
  809.  
  810.  
  811.           Reducer questions operate just like free_form except that after
  812.           confirming DialogPro compares the response to a list of available
  813.           responses.  If there is only one response which matches the
  814.           current response -- nothing happens.  If more than one available
  815.           response begin with the same letters as the given response, the
  816.           response is considered ambiguous and a list of possible matches
  817.           is displayed in a pulldown list.  The user then selects his
  818.           response from the pulldown list.
  819.           
  820.           The user can skip the reduction stage and go straight to the list
  821.           by pressing EXPAND.
  822.           
  823.           The user can view the entire list by double-clicking or holding
  824.           on the response area with the mouse.
  825.           
  826.           
  827.           LIST
  828.           
  829.           There are two types of lists, select list and checklist.  The
  830.           checklist allows more than one item to be "checked-off."  he
  831.           select list allows only one item at a time to be "checked-off."
  832.           
  833.           A list response area is rectangular.  If the list is bigger than
  834.           the rectangular area the user can scroll the list.
  835.           
  836.           The user can modify the selections by placing the cursor inside
  837.           the list.  The user can then check-off items using PRESS_BUTTON
  838.           or navigate to another question.  
  839.           
  840.           With the mouse, clicking on an item in the list will toggle it
  841.           between checked and un-checked.  Holding or clicking on the
  842.           scroll bar hotpoints, or holding and dragging the scroll bar
  843.           thumbwheels scroll the list.
  844.           
  845.           
  846.           BUTTON
  847.           
  848.           The user executes a button by pressing the key it is "bound" to. 
  849.           Pressing the "bound" key will place the button's command key in
  850.           the message queue.  This lets buttons behave as another way of
  851.           executing a CONFIRM, or ABORT, or any command -- or keystroke.  A
  852.           kind of visual representation of commands.
  853.           
  854.           You can also execute a button by pressing its mnemonic key.  Its
  855.           mnemonic key will first make the button the selected question and
  856.           then put the command key in the message queue.  The basic
  857.           difference is that the first method does not change the selected
  858.           question, or highlighting.  This method changes the highlighted
  859.           item to the button.
  860.           
  861.           You can also execute a button by navigating to it (or
  862.           highlighting it) and then executing PRESS_BUTTON.
  863.           
  864.  
  865.  
  866.  
  867.  
  868.                                        - 10 -
  869.  
  870.  
  871.  
  872.  
  873.  
  874.           DialogPro v 2.1                                       Users Guide
  875.                                                            Reference Manual
  876.  
  877.  
  878.           With the mouse, clicking on a button is the same as pressing the
  879.           "bound" key.  Holding on a button and then releasing it the same
  880.           as pressing the mnemonic key.
  881.           
  882.           Buttons may or may not have a border.  Buttons without borders
  883.           are useful for making words in a text behave like hot-points
  884.           (useful in hypertext type applications, help screens, etc.) or in
  885.           creating new hot-points that work like the scroll bars, for
  886.           example, creating a sliding scale in a dialog box would be done
  887.           with borderless buttons representing different parts of the scale
  888.           (an up button, a down button, the scale itself, etc. -- this lets
  889.           users literally reach out and grab a piece of your invention and
  890.           move it around the screen, pull levers, push buttons, and move
  891.           sliding scales.)
  892.           
  893.           SCROLLING TEXT
  894.           
  895.           Scrolling text questions is really a misnomer.  Scrolling text
  896.           allows you to place a sub-window within the dialog box and then
  897.           associate a controlling routine with that sub-window.  Some of
  898.           the common uses for this would be, for example, a box of
  899.           scrolling text, or a sub-dialog box.  Sample control routines for
  900.           both of these types of SCROLLING TEXT questions are included. 
  901.           But, you can create your own routines, infinitely extending the
  902.           abilities of The DialogPro.
  903.           
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.                                        - 11 -
  936.  
  937.  
  938.  
  939.  
  940.  
  941.           DialogPro v 2.1                                       Users Guide
  942.                                                            Reference Manual
  943.  
  944.  
  945.           IV.   Shareware
  946.           
  947.           Seabreeze Software distributes DialogPro under the shareware
  948.           marketing concept.  Because DialogPro is shareware you can freely
  949.           copy and share the DialogPro shareware diskette with its programs
  950.           and manual.  You can also obtain it from Seabreeze Software for
  951.           $15 (the cost of the diskette, postage, and handling.)  In fact,
  952.           we hope you do help us by sharing unmodified copies of the
  953.           DialogPro shareware diskette with other programmers.
  954.           
  955.           You may incorporate DialogPro into your programs and distribute
  956.           those programs absolutely royalty free (see registration section
  957.           for details.)  You may not however sell, or give away, the
  958.           DialogPro source code -- even if you purchase the right to use it
  959.           (see registration section.)
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.                                        - 12 -
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.           DialogPro v 2.1                                       Users Guide
  1009.                                                            Reference Manual
  1010.  
  1011.  
  1012.           V.    Registration
  1013.           
  1014.           Shareware is software which can be freely copied and
  1015.           distributed.  It is copyrighted software which the author
  1016.           encourages people to copy and share with others.
  1017.           
  1018.           You can register with Seabreeze Software for three levels of
  1019.           support:
  1020.           
  1021.            .  For $50 you receive
  1022.           
  1023.                .  A serialized diskette containing all the latest libraries
  1024.                   for all supported compilers and memory models.
  1025.                
  1026.                .  Single user telephone support (BBS, Compuserve, and
  1027.                   voice.)  See next section for details.
  1028.                
  1029.                .  Notification of updates for one year.
  1030.           
  1031.            .  For $100 you receive 
  1032.            
  1033.                .  the above, and
  1034.                .  one hundred pages of liberally commented source code (on
  1035.                   diskette,) 
  1036.                
  1037.                   This support-level is usable for non-commercial
  1038.                   programs.  Non-commercial programs are those created for
  1039.                   limited user (less than 50 users) installations (as
  1040.                   typically might be found in a small consulting situation
  1041.                   or a small corporate software development setting,) or
  1042.                   for unlimited shareware or freeware distribution.
  1043.             
  1044.            .  For $200 you receive 
  1045.            
  1046.                .  the above, plus 
  1047.                .  the right to use DialogPro in commercial applications. 
  1048.            
  1049.            .  Call for details regarding site licensing, consulting
  1050.               services, and customizations.
  1051.              
  1052.           
  1053.           Seabreeze Software retains the following rights:
  1054.           
  1055.            .  If you purchase the source code you may not distribute it
  1056.               except as part of an application program.  In other words,
  1057.               you can't resell the source in its current or modified form
  1058.               in a way that competes with the original product.  
  1059.            
  1060.            .  If you provide the DialogPro source code to a purchaser of
  1061.               your applications software you must leave the remarks in the
  1062.               source code indicating that the original copyright is held by
  1063.               Seabreeze Software.  If you rewrite portions of DialogPro you
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.                                        - 13 -
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.           DialogPro v 2.1                                       Users Guide
  1076.                                                            Reference Manual
  1077.  
  1078.  
  1079.               must point out the modifications made by yourself and you are
  1080.               legally obligated to leave the original copyright notice in
  1081.               the source code.
  1082.            
  1083.            .  Seabreeze Software may modify its pricing and distribution
  1084.               policies at any time without notification.  This does not
  1085.               imply that we will not honor our contractual obligations. But
  1086.               that we reserve the right to not contract for the above
  1087.               services at the above prices, i.e. we are not bound by 'old'
  1088.               advertising.
  1089.           
  1090.           The registration form is at the back of this manual.
  1091.           
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.                                        - 14 -
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.           DialogPro v 2.1                                       Users Guide
  1143.                                                            Reference Manual
  1144.  
  1145.  
  1146.           VI.   Support Details
  1147.           
  1148.           Support is provided by
  1149.           
  1150.            .  E-mail.  Send mail to Seabreeze Software, Compuserve ID#
  1151.               72330, 705
  1152.            
  1153.            .  Voice.  You may call Seabreeze Software directly at
  1154.               609-924-6793, Monday through Friday, 9 a.m. to 5 p.m. 
  1155.               Eastern Time.
  1156.           
  1157.           Technical support is available to registered users only, you must
  1158.           leave your license agreement number, your name, and instructions
  1159.           for answering the question (like - "please answer via Compuserve
  1160.           E-mail ID# XXXXX, XXX." or  "Please call me at XXX-XXX-XXXX for
  1161.           verbal consultation.")  Give as many details as possible. 
  1162.           Answers will generally be received within 24 hours or less,
  1163.           Monday through Friday.
  1164.           
  1165.           Seabreeze Software will respond to general questions from
  1166.           unregistered users, like "I have version X.XX, what is the latest
  1167.           version?" or "What is the current price for support level X?"  We
  1168.           cannot respond to technical questions from unregistered users.
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.                                        - 15 -
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.           DialogPro v 2.1                                       Users Guide
  1210.                                                            Reference Manual
  1211.  
  1212.  
  1213.           VII.  Diskette
  1214.           
  1215.           The shareware diskettes should contain the following files:
  1216.           
  1217.           READ.ME             Any last minute corrections, additions, etc.
  1218.           PKXARC.COM          Unarchives Pro.arc
  1219.           DBPRO1.ARC          This manual and demo exe files
  1220.           DBPRO2.ARC          Required include, batch, and source files
  1221.           DBPRO3.ARC          Microsoft MS C/Quick-C libraries
  1222.           DBPRO4.ARC          Turbo-C libraries
  1223.           DBPRO5.ARC          Quick-C quicklib
  1224.           
  1225.           dbpro1.arc, dbpro2.arc, dbpro3.arc, dbpro4.arc  & dbpro5.arc
  1226.           contain:
  1227.           
  1228.           DBPRO.TXT           Users guide and reference manual for The
  1229.                               DialogPro
  1230.           DBCHANGE.TXT        Summary of changes between various DialogPro
  1231.                               versions.
  1232.           MSDBPROM.LIB        DialogPro MS C 5.X / Quick C 1.X medium model
  1233.                               library
  1234.           MSDBPROL.LIB        DialogPro MS C 5.X / Quick C 1.X large model
  1235.                               library
  1236.           QCDBPRO.C           This file is a "stub" function that
  1237.                               references all DialogPro functions.  It
  1238.                               allows you to create a Quick-C 1.X quicklib. 
  1239.                               See your Quick-C manual for further
  1240.                               information.
  1241.           TCDBPROM.LIB        DialogPro Turbo C medium model library
  1242.           TCDBPROL.LIB        DialogPro Turbo C large model library
  1243.           DBERRORS.H          DialogPro include files
  1244.           DBOPS.H                  "
  1245.           DBPRO.H                  "
  1246.           SIMPLEDB.C          Easy example of a simple dialog box
  1247.           SIMPLEDB.PRJ        Turbo-C project file for above sample
  1248.                               program.
  1249.           CLONE.C             Another sample dialog box & Turbo-C project
  1250.                               file.
  1251.           CLONE.PRJ
  1252.           QCDBPROM.BAT        Generic Quick C medium model DialogPro
  1253.                               compile/link batch file
  1254.           QCDBPROL.BAT        Generic Quick C large model DialogPro
  1255.                               compile/link batch file
  1256.           MSDBPROM.BAT        Generic MS C medium model DialogPro
  1257.                               compile/link batch file
  1258.           MSDBPROL.BAT        Generic MS C large model DialogPro
  1259.                               compile/link batch file
  1260.           TCDBPROM.BAT        Generic Turbo C medium model DialogPro
  1261.                               compile/link batch file
  1262.           TCDBPROL.BAT        Generic Turbo C large model DialogPro
  1263.                               compile/link batch file
  1264.           DBTEST.EXE          DialogPro resource file test program
  1265.           IDXTEST.EXE         Resource file indexer
  1266.           TEST.RSC            Sample resource file
  1267.  
  1268.  
  1269.  
  1270.                                        - 16 -
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.           DialogPro v 2.1                                       Users Guide
  1277.                                                            Reference Manual
  1278.  
  1279.  
  1280.           TEST.IDX                 "      "        index
  1281.           DEMO.BAT            Resource file demo
  1282.           HYPEITLM.LIB        MS C 5.X HypeIt! large model lib
  1283.           HYPEITLT.LIB        Turbo-C 2.X Hypeit! large model lib
  1284.           HYPEIT.EXE          HypeIt! document previewer
  1285.           HYPEIT.TXT          HypeIt! documentation file (a hyperdoc)
  1286.           HYPEIT.IDX          HypeIt! documentation file index
  1287.           COLRLIST.EXE        HypeIt! color codes program
  1288.           
  1289.           Note: BBS operators may repackage The DialogPro files to optimize
  1290.           on-line time.  If you received your files via a BBS please make
  1291.           sure you have all of The DialogPro shareware files.
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.                                        - 17 -
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.           DialogPro v 2.1                                       Users Guide
  1344.                                                            Reference Manual
  1345.  
  1346.  
  1347.           VIII. Installation
  1348.           
  1349.             1. Backup your shareware diskette.
  1350.             
  1351.             2. Type "pkxarc dbpro1" at the dos prompt and press ENTER, and
  1352.                then "pkxarc dbpro2".  Pkxarc will unarc dbpro1.arc &
  1353.                dbpro2.arc into the current default directory.  You can run
  1354.                pkxarc.exe from another directory, and unarc dbpro1.arc
  1355.                located on another drive or directory by preceding each with
  1356.                a drive and directory specification, for example
  1357.             
  1358.             
  1359.                C:\Pro>a:pkxarc a:dbpro1
  1360.             
  1361.                will run pkxarc from the a: drive and unarc dbpro1.arc
  1362.                located on the a: drive into the c: drive and the "Pro"
  1363.                sub-directory.
  1364.             
  1365.                Repeat for dbpro3.arc and dbpro4.arc.
  1366.             
  1367.             3. Copy the library files for your compiler (extension of
  1368.                ".lib") to the diskette or sub-directory you usually use
  1369.                with your C compiler.  The lib files should be in the same
  1370.                sub-directory as your C runtime libraries.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.                                        - 18 -
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.           DialogPro v 2.1                                       Users Guide
  1411.                                                            Reference Manual
  1412.  
  1413.  
  1414.           IX.   Compiling and linking the demo
  1415.           
  1416.           Confirm proper installation by compiling one of the demo
  1417.           programs, simpledb.c by typing the following (choose the one that
  1418.           corresponds to your compiler and memory model.)
  1419.           
  1420.                msdbprol simpledb
  1421.                msdbprom simpledb
  1422.                qcdbprol simpledb
  1423.                qcdbprom simpledb
  1424.                tcdbprol simpledb
  1425.                tcdbprom simpledb
  1426.           
  1427.           If you were unable to compile and link check to make sure that:
  1428.           
  1429.           TURBO-C :
  1430.           
  1431.           Determine that you have all of the files listed on the previous
  1432.           page.  Turbo-C is installed as described in the Turbo-C manual,
  1433.           you are compiling from the TURBOC directory,  the source files
  1434.           are in the default sub-directory, and the TCDBPRO?.LIB files are
  1435.           installed in the LIB sub-directory.
  1436.           
  1437.           QUICK-C :
  1438.           
  1439.           Determine that the LIB, TMP, BIN, and INCLUDE environment
  1440.           variables have been properly initialized, the MSDBPRO?.LIB files
  1441.           are included in the subdirectory associated with LIB environment
  1442.           variable, and the source files are in your default directory.
  1443.           
  1444.           If the problem persists contact Seabreeze Software Customer
  1445.           Support.
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.                                        - 19 -
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.           DialogPro v 2.1                                       Users Guide
  1478.                                                            Reference Manual
  1479.  
  1480.  
  1481.           X.    DialogPro Reference
  1482.           
  1483.           A. Introduction
  1484.           
  1485.           Generally speaking you only need to be familiar with the
  1486.           functions db_run, lst_run, db_switchqueue, and the data
  1487.           structures dialog_box and list_rec.  All of the other functions
  1488.           are documented solely to assist the application programmer in
  1489.           writing pre and post routines to attach to questions.  Using
  1490.           these functions can help you do things like modify the dialog_box
  1491.           structure based on an interim response.  Typically this technique
  1492.           is used to gray-out a questions in a dialog box based on another
  1493.           response or to perform other similar processes.
  1494.           
  1495.           The DialogPro is targeted for experienced applications
  1496.           developers.  The best way to learn how to use the DialogPro is by
  1497.           studying, running, and modifying the sample programs.
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.                                        - 20 -
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.           DialogPro v 2.1                                       Users Guide
  1545.                                                            Reference Manual
  1546.  
  1547.  
  1548.           B. Functions
  1549.           
  1550.           1.  db_display
  1551.           
  1552.           a. Summary
  1553.           
  1554.           #include "dbpro.h"
  1555.           #include "dbpro.h"
  1556.           
  1557.           int db_display(db_ptr)
  1558.                          ______ 
  1559.           i                    )
  1560.                          ______ 
  1561.           
  1562.           dialog_box *db_ptr;
  1563.                       _______
  1564.           dialog_box *       
  1565.                       _______
  1566.           
  1567.           
  1568.           b. Description
  1569.           
  1570.           Displays the dialog box pointed to by dp_ptr. If the window
  1571.                                                 ________             
  1572.           associated with db_ptr is not on the screen it will be opened via
  1573.                           ______                                           
  1574.           a call to wn_openw.  If the window associated with the dialog box
  1575.                     wn_openw                                               
  1576.           (db_ptr->handle) is open but is not the last_wdw (on top of the
  1577.            ______                                                        
  1578.                  ->handle                         last_wdw               
  1579.            ______                                                        
  1580.           stack of windows) and db_ptr->bg_operation is TRUE it will be
  1581.                                 ______                                 
  1582.                                       ->bg_operation                   
  1583.                                 ______                                 
  1584.           brought to the top of the stack by a call to wn_openw.
  1585.                                                        wn_openw 
  1586.           
  1587.           
  1588.           c. Return Value
  1589.           
  1590.           See section Standard Return Values.
  1591.           
  1592.           
  1593.           2.  db_displayq
  1594.           
  1595.           a. Summary
  1596.           
  1597.           #include "dbpro.h"
  1598.           #include "dbpro.h"
  1599.           
  1600.           int db_displayq(db_ptr, question_id)
  1601.                           ______  ___________ 
  1602.           int db_displayq(      ,            )
  1603.                           ______  ___________ 
  1604.           
  1605.           dialog_box *db_ptr;
  1606.                       _______
  1607.           dialog_box *       
  1608.                       _______
  1609.           unsigned char question_id;
  1610.                         ____________
  1611.           unsigned char             
  1612.                         ____________
  1613.           
  1614.           
  1615.           b. Description
  1616.           
  1617.           Displays the question pointed to by
  1618.           db_ptr->questions[question_id] in the window db_ptr->handle.
  1619.           ______            ___________                ______         
  1620.                 ->questions[           ]                     ->handle 
  1621.           ______            ___________                ______         
  1622.           
  1623.           
  1624.           c. Return Value
  1625.           
  1626.           See section Standard Return Values.
  1627.           
  1628.           
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.                                        - 21 -
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.           DialogPro v 2.1                                       Users Guide
  1642.                                                            Reference Manual
  1643.  
  1644.  
  1645.           3.  db_flushqueue
  1646.           
  1647.           a. Summary
  1648.           
  1649.           #include "dbpro.h"
  1650.           #include "dbpro.h"
  1651.           
  1652.           void db_flushqueue(void)
  1653.                              ____ 
  1654.           void db flushqueue      
  1655.                              ____ 
  1656.           
  1657.           
  1658.           b. Description
  1659.           
  1660.           Clears all messages in the queue, db_queue.  Indiscriminate use
  1661.                                             db queue                     
  1662.           of db_flushqueue() is not advised.  It may interfere with the
  1663.           processing of macros.  It is best to discard only those messages
  1664.           which you are sure you do not want.
  1665.           
  1666.           
  1667.           c. Return Value
  1668.           
  1669.           None.
  1670.           
  1671.           
  1672.           4.  db_freestorage
  1673.           
  1674.           a. Summary
  1675.           
  1676.           #include "dbpro.h"
  1677.           #include "dbpro.h"
  1678.           
  1679.           int db_freestorage(db_ptr, insurance)
  1680.                              ______  _________ 
  1681.           int db_freestorage(      ,          )
  1682.                              ______  _________ 
  1683.           
  1684.           dialog_box *db_ptr;
  1685.                       _______
  1686.           dialog_box *       
  1687.                       _______
  1688.           storage **insurance;
  1689.                     __________
  1690.           storage **          
  1691.                     __________
  1692.           
  1693.           
  1694.           b. Description
  1695.           
  1696.           If *insurance does not equal NULL the data structure pointed to
  1697.              __________                                                  
  1698.                                        NULL                              
  1699.              __________                                                  
  1700.           by *insurance is freed and *insurance is set to NULL.
  1701.              __________              __________                
  1702.                                                           NULL 
  1703.              __________              __________                
  1704.           
  1705.           If *insurance is equal to NULL, nothing happens.
  1706.              __________                                   
  1707.                                     NULL                  
  1708.              __________                                   
  1709.           
  1710.           (Normally **insurance is the same as &(db_ptr->insurance). 
  1711.                     ___________                  ______              
  1712.                                                &(      ->insurance)  
  1713.                     ___________                  ______              
  1714.           db_ptr->insurance is used by db_run to point to the previous
  1715.           ______                                                      
  1716.                 ->insurance            db_run                         
  1717.           ______                                                      
  1718.           answers to the dialog box.)
  1719.           
  1720.           
  1721.           c. Return Value
  1722.           
  1723.           See section Standard Return Values.
  1724.           
  1725.           
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.                                        - 22 -
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.           DialogPro v 2.1                                       Users Guide
  1739.                                                            Reference Manual
  1740.  
  1741.  
  1742.           5.  db_pop
  1743.           
  1744.           a. Summary
  1745.           
  1746.           #include "dbpro.h"
  1747.           #include "dbpro.h"
  1748.           
  1749.           unsigned db_pop(void)
  1750.                           ____ 
  1751.           unsigned db pop      
  1752.                           ____ 
  1753.           
  1754.           
  1755.           b. Description
  1756.           
  1757.           Reads the next message from the tail of the queue, db_queue.
  1758.                                                              db queue 
  1759.           
  1760.           
  1761.           c. Return Value
  1762.           
  1763.           <> - 1    Function executed properly.
  1764.           
  1765.           -1        The queue is empty.
  1766.           
  1767.           
  1768.           6.  db_priority
  1769.           
  1770.           a. Summary
  1771.           
  1772.           #include "dbpro.h"
  1773.           #include "dbpro.h"
  1774.           
  1775.           int db_priority(new_event)
  1776.                           ___ _____ 
  1777.           int db priority           
  1778.                           ___ _____ 
  1779.           
  1780.           unsigned new_event;
  1781.                    ___ _____ 
  1782.           unsigned           
  1783.                    ___ _____ 
  1784.           
  1785.           
  1786.           b. Description
  1787.           
  1788.           Puts new_message at the tail of the queue, db_queue.
  1789.                ___ _______                                    
  1790.                                                      db queue 
  1791.                ___ _______                                    
  1792.           
  1793.           
  1794.           c. Return Value
  1795.           
  1796.           TRUE      Function executed properly.
  1797.           TRUE                                 
  1798.           
  1799.           FALSE     The queue is full (a queue can only have 256 messages
  1800.           FALSE                                                          
  1801.                     in it.)
  1802.           
  1803.           
  1804.           7.  db_push
  1805.           
  1806.           a. Summary
  1807.           
  1808.           #include "dbpro.h"
  1809.           #include "dbpro.h"
  1810.           
  1811.           int db_push(new_event)
  1812.                       ___ _____ 
  1813.           int db push           
  1814.                       ___ _____ 
  1815.           
  1816.           unsigned new_event;
  1817.                    ___ _____ 
  1818.           unsigned           
  1819.                    ___ _____ 
  1820.  
  1821.  
  1822.  
  1823.                                        - 23 -
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.           DialogPro v 2.1                                       Users Guide
  1830.                                                            Reference Manual
  1831.  
  1832.  
  1833.           b. Description
  1834.           
  1835.           Puts new_message at the head of the queue, db_queue.
  1836.                ___ _______                                    
  1837.                                                      db queue 
  1838.                ___ _______                                    
  1839.           
  1840.           
  1841.           c. Return Value
  1842.           
  1843.           TRUE      Function executed properly.
  1844.           TRUE                                 
  1845.           
  1846.           FALSE     The queue is full (a queue can only have 256 messages
  1847.           FALSE                                                          
  1848.                     in it.)
  1849.           
  1850.           
  1851.           8.  db_restoreanswers
  1852.           
  1853.           a. Summary
  1854.           
  1855.           #include "dbpro.h"
  1856.           #include "dbpro.h"
  1857.           
  1858.           int db_restoreanswers(db_ptr, insurance)
  1859.                                 ______  _________ 
  1860.           int db_restoreanswers(      ,          )
  1861.                                 ______  _________ 
  1862.           
  1863.           dialog_box *db_ptr;
  1864.                       _______
  1865.           dialog_box *       
  1866.                       _______
  1867.           storage **insurance;
  1868.                     __________
  1869.           storage **          
  1870.                     __________
  1871.           
  1872.           
  1873.           b. Description
  1874.           
  1875.           If *insurance is not equal to NULL the answers to the dialog box,
  1876.              __________                                                    
  1877.                                         NULL                               
  1878.              __________                                                    
  1879.           db_ptr, are changed to the answers recorded in the data structure
  1880.           ______                                                           
  1881.           (which only contains the answers) of type storage pointed to by
  1882.                                                     storage              
  1883.           *insurance.  The storage data structure is freed and *insurance
  1884.           __________                                                     
  1885.                            storage                                       
  1886.           __________                                                     
  1887.           is set to NULL.
  1888.                     NULL 
  1889.           
  1890.           If insurance is equal to NULL, nothing happens.
  1891.              _________                                   
  1892.                                    NULL                  
  1893.              _________                                   
  1894.           
  1895.           (Normally **insurance is the same as &(db_ptr->insurance). 
  1896.                     ___________                  ______              
  1897.                                                &(      ->insurance)  
  1898.                     ___________                  ______              
  1899.           db_ptr->insurance is used by db_run to point to the previous
  1900.           ______                                                      
  1901.                 ->insurance            db_run                         
  1902.           ______                                                      
  1903.           answers to the dialog box.)
  1904.           
  1905.           
  1906.           c. Return Value
  1907.           
  1908.           See section Standard Return Values.
  1909.           
  1910.           
  1911.           9.  db_run
  1912.           
  1913.           a. Summary
  1914.           
  1915.           #include "dbpro.h"
  1916.           #include "dbpro.h"
  1917.           
  1918.           int db_run(db_ptr, message)
  1919.                      ______  _______ 
  1920.           int db_run(      , message)
  1921.                      ______  _______ 
  1922.           
  1923.           dialog_box *db_ptr;
  1924.                       _______
  1925.           dialog_box *       
  1926.                       _______
  1927.  
  1928.  
  1929.  
  1930.                                        - 24 -
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.           DialogPro v 2.1                                       Users Guide
  1937.                                                            Reference Manual
  1938.  
  1939.  
  1940.           unsigned message;
  1941.                    ________
  1942.           unsigned         
  1943.                    ________
  1944.           
  1945.           
  1946.           b. Description
  1947.           
  1948.           The function db_run executes the messages in the message queue
  1949.                        db_run                                           
  1950.           pointed to by db_queue against the dialog box data structure
  1951.                         db_queue                                      
  1952.           db_ptr.  (It is very important that a message queue have been
  1953.           ______                                                       
  1954.           initialized via a call to db_switchqueue before calling db_run.)
  1955.                                     db switchqueue                db run  
  1956.           
  1957.           Before executing the message queue it first places the standard
  1958.           message STORAGE at the tail of the queue and then it places the
  1959.                   STORAGE                                                
  1960.           parameter message at the head of the queue.  All messages are
  1961.                     _______                                            
  1962.           retrieved from the tail of the queue.  Each retrieved message is
  1963.           checked against the macro list db_ptr->macros.  If the message is
  1964.                                          ______                            
  1965.                                                ->macros                    
  1966.                                          ______                            
  1967.           a macro it is expanded by placing the items pointed to by the
  1968.           macro at the tail of the queue in reverse order.
  1969.           
  1970.           If there are no messages in the message queue db_run polls the
  1971.                                                         db_run          
  1972.           kyeboard and mouse (if one is recognized when wn_init is
  1973.           called.)  When activity is noted the keyboard/mouse activity is
  1974.           translated into a message and placed at the tail of the queue.
  1975.           
  1976.           If it is a mouse event the message MOUSE_EVENT is placed at the
  1977.                                              MOUSE_EVENT                 
  1978.           tail of the queue.  The MOUSE_EVENT message takes the last mouse
  1979.                                   MOUSE_EVENT                             
  1980.           event, translates it into a message and places it at the tail of
  1981.           the queue.
  1982.           
  1983.           It it is a keyboard event, the keystroke is first compared
  1984.           against the the shortcut key of each of the questions, starting
  1985.           at the current question + 1 and ending at the current question. 
  1986.           The first question whose shortcut key matches the keystroke is
  1987.           selected.   If the question is a button and it matches
  1988.           BUTTONQUEST(question_id)->key the button is selected, the
  1989.           BUTTONQUEST(question_id)->key                            
  1990.           keystroke value is replaced with the value
  1991.           BUTTONQUEST(question_id)->cmd_key, and the global variable
  1992.           BUTTONQUEST(question_id)->cmd_key                         
  1993.           button_press is set the the value of
  1994.           button_press                        
  1995.           BUTTONQUEST(question_id)->exitval.  If the question is a button
  1996.           BUTTONQUEST(question_id)->exitval                              
  1997.           and it matches BUTTONQUEST(question_id)->keybind the current
  1998.                          BUTTONQUEST(question_id)->keybind            
  1999.           question remains selected, and the keystroke value is replaced
  2000.           with the value BUTTONQUEST(question_id)->cmd_key, and the global
  2001.                          BUTTONQUEST(question_id)->cmd_key                
  2002.           variable button_press is set the the value of
  2003.           BUTTONQUEST(question_id)->exitval.  
  2004.           BUTTONQUEST(question_id)->exitval   
  2005.           
  2006.           The new keystroke value is then compared against the
  2007.           keystroke-command table.  If the keystroke is in the table the
  2008.           keystroke is interpreted into a standard event.  If it is not, it
  2009.           is processed as a keystroke value.  Alphanumeric Keystrokes can
  2010.           be used to begin editing a free_form, a reducer, or select a
  2011.           multiple choice response.
  2012.           
  2013.           When one of several exit type messages is received db_run
  2014.           terminates.
  2015.           
  2016.  
  2017.  
  2018.  
  2019.                                        - 25 -
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.           DialogPro v 2.1                                       Users Guide
  2026.                                                            Reference Manual
  2027.  
  2028.  
  2029.           The actual message selection/interpretation code explains it a
  2030.           little more succinctly:
  2031.           
  2032.           do {
  2033.           
  2034.                /* get event from queue */
  2035.                if (!NO_EVENT) event = db_pop();                       
  2036.           
  2037.                /* or from keyboard/mouse */
  2038.                else event = get_dbevent(db_ptr);
  2039.           
  2040.           } while
  2041.                
  2042.                /* expand macros */
  2043.                (db_executemacros(event, db_ptr->macros));
  2044.           
  2045.           
  2046.           /* if event is a keystroke value ... */
  2047.           if (event > 256) {
  2048.           
  2049.                /* get ascii code */
  2050.                ascii = event % 256;
  2051.           
  2052.                /* check shortcut keys */
  2053.                button_press = db_touchbutton(db_ptr, &event);
  2054.           
  2055.                /* translate into a message */
  2056.                event = db_getopcode(db_ptr, event);
  2057.           }
  2058.           
  2059.           
  2060.           
  2061.           
  2062.           c. Return Value
  2063.           
  2064.           See section Standard Return Values.
  2065.           
  2066.           Note that if this function returns with a value of CONFIRMED or
  2067.           ABORTED that it has also placed a CONFIRM or ABORT message in the
  2068.           queue.  Many programmers find that using the queue for sending
  2069.           and receiving arguments and return values is the cleanest way to
  2070.           use the DialogPro.  On the other hand, particularly if you are
  2071.           integrating the DialogPro into an existing application you may
  2072.           want to discard these messages.  Use db_pop() to discard the
  2073.           unwanted message, or db_flushqueue() to discard all messages in
  2074.           the queue.
  2075.           
  2076.           
  2077.           10. db_selectq
  2078.           
  2079.           a. Summary
  2080.           
  2081.           #include "dbpro.h"
  2082.           #include "dbpro.h"
  2083.           
  2084.  
  2085.  
  2086.  
  2087.                                        - 26 -
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.           DialogPro v 2.1                                       Users Guide
  2094.                                                            Reference Manual
  2095.  
  2096.  
  2097.           int db_selectq(db_ptr, question_id)
  2098.                          ______  ___________ 
  2099.           int db_selectq(      ,            )
  2100.                          ______  ___________ 
  2101.           
  2102.           dialog_box *db_ptr;
  2103.                       _______
  2104.           dialog_box *       
  2105.                       _______
  2106.           unsigned char question_id;
  2107.                         ____________
  2108.           unsigned char             
  2109.                         ____________
  2110.           
  2111.           
  2112.           b. Description
  2113.           
  2114.           Makes db_ptr->id_select equal to question_id.  Then displays the
  2115.           question pointed to previously by
  2116.           db_ptr->questions[db_ptr->id_select] (dehighlighting the
  2117.           question) and then displays the question
  2118.           db_ptr->questions[question_id] (highlighting it--as it is now the
  2119.           ______            ___________                                    
  2120.                 ->questions[           ]                                   
  2121.           ______            ___________                                    
  2122.           selected question.)
  2123.           
  2124.           Before dehighlighting the first question, the function pointed to
  2125.           by (*) FIRST_QUESTION->whenoff(db_ptr) is executed, if
  2126.           FIRST_QUESTION->whenoff(db_ptr) does not return TRUE db_selectq
  2127.           terminates without modifying db_ptr->id_select.
  2128.           
  2129.           After dehighlighting the second question, the function pointed to
  2130.           by (*) SECOND_QUESTION->whenon(db_ptr) is executed, if
  2131.           SECOND_QUESTION->whenon(db_ptr) does not return TRUE db_selectq
  2132.           terminates without modifying db_ptr->id_select.
  2133.           
  2134.           
  2135.           (*) FIRST_QUESTION and SECOND_QUESTION are generic pointers use
  2136.           for illustrative purposes representing what would be the specific
  2137.           pointer type for each question.  Each question type has its own
  2138.           pointer type.
  2139.           
  2140.           
  2141.           c. Return Value
  2142.           
  2143.           See section Standard Return Values.
  2144.           
  2145.           
  2146.           11. db_storeanswers
  2147.           
  2148.           a. Summary
  2149.           
  2150.           #include "dbpro.h"
  2151.           #include "dbpro.h"
  2152.           
  2153.           int db_storeanswers(db_ptr, insurance)
  2154.                               ______  _________ 
  2155.           int db_storeanswers(      ,          )
  2156.                               ______  _________ 
  2157.           
  2158.           dialog_box *db_ptr;
  2159.                       _______
  2160.           dialog_box *       
  2161.                       _______
  2162.           storage **insurance;
  2163.                     __________
  2164.           storage **          
  2165.                     __________
  2166.           
  2167.           
  2168.  
  2169.  
  2170.  
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.                                        - 27 -
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.           DialogPro v 2.1                                       Users Guide
  2183.                                                            Reference Manual
  2184.  
  2185.  
  2186.           b. Description
  2187.           
  2188.           If *insurance is equal to NULL the answers to the dialog box,
  2189.              __________                                                
  2190.                                     NULL                               
  2191.              __________                                                
  2192.           db_ptr, are stored in an interim data structure (which only
  2193.           ______                                                     
  2194.           contains the answers) of type storage and *insurance returns the
  2195.                                                     __________            
  2196.                                         storage                           
  2197.                                                     __________            
  2198.           pointer to the data structure.
  2199.           
  2200.           If insurance is not equal to NULL, nothing happens.
  2201.              _________                                       
  2202.                                        NULL                  
  2203.              _________                                       
  2204.           
  2205.           (Normally **insurance is the same as &(db_ptr->insurance). 
  2206.                     ___________                  ______              
  2207.                                                &(      ->insurance)  
  2208.                     ___________                  ______              
  2209.           db_ptr->insurance is used by db_run to point to the previous
  2210.           ______                                                      
  2211.                 ->insurance            db_run                         
  2212.           ______                                                      
  2213.           answers to the dialog box.)
  2214.           
  2215.           
  2216.           c. Return Value
  2217.           
  2218.           See section Standard Return Values.
  2219.           
  2220.           
  2221.           12. db_switchqueue
  2222.           
  2223.           a. Summary
  2224.           
  2225.           #include "dbpro.h"
  2226.           #include "dbpro.h"
  2227.           
  2228.           int db_switchqueue(head, tail, queue)
  2229.                              ____  ____  _____ 
  2230.           int db switchqueue                   
  2231.                              ____  ____  _____ 
  2232.           
  2233.           unsigned char *head, *tail;
  2234.                          ____   ____ 
  2235.           unsigned char              
  2236.                          ____   ____ 
  2237.           unsigned *queue;
  2238.                     _____ 
  2239.           unsigned        
  2240.                     _____ 
  2241.           
  2242.           
  2243.           b. Description
  2244.           
  2245.           db_switchqueue associates variables representing the head, tail,
  2246.           db switchqueue                                                  
  2247.           and circular message queue used by db_run and lst_run.  This
  2248.                                              db run     lst run       
  2249.           function must be called once before using db_run or lst_run.  It
  2250.                                                     db run    lst run     
  2251.           only has to be called once and then db_run and lst_run can be
  2252.                                               db run     lst run       
  2253.           used as many times necessary.  You can however call this more
  2254.           than once if you want to use separate message queues for
  2255.           different dialog boxes.
  2256.           
  2257.           queue must be a pointer to a 512 byte memory block (256
  2258.           _____                                                  
  2259.           integers.) head and tail should be pointers to existing unsigned
  2260.                      ____     ____                                        
  2261.           chars.  head and tail should be initialized to their proper
  2262.                   ____     ____                                      
  2263.           values before calling db_switchqueue.  If you are just
  2264.                                 db switchqueue                  
  2265.           initializing a brand new queue both would be 0.
  2266.           
  2267.           
  2268.           c. Return Value
  2269.           
  2270.           None.
  2271.           
  2272.           
  2273.  
  2274.  
  2275.  
  2276.  
  2277.                                        - 28 -
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.           DialogPro v 2.1                                       Users Guide
  2284.                                                            Reference Manual
  2285.  
  2286.  
  2287.           13. lst_display
  2288.           
  2289.           a. Summary
  2290.           
  2291.           #include "dbpro.h"
  2292.           #include "dbpro.h"
  2293.           
  2294.           int lst_display(list_ptr, mode)
  2295.                           ________  ____ 
  2296.           int lst_display                
  2297.                           ________  ____ 
  2298.           
  2299.           list_rec *list_ptr;
  2300.                     ________ 
  2301.           list_rec *         
  2302.                     ________ 
  2303.           unsigned char mode;
  2304.                         ____ 
  2305.           unsigned char      
  2306.                         ____ 
  2307.           
  2308.           
  2309.           b. Description
  2310.           
  2311.           Refreshes the display of the list, list_ptr.
  2312.                                              ________ 
  2313.           
  2314.           
  2315.           If mode is equal to 
  2316.              ____             
  2317.           
  2318.           0         The window, lst_ptr->handle, is brought to the top of
  2319.                                 ________ ______                          
  2320.                                 lst_ptr                                  
  2321.                                 ________ ______                          
  2322.                     the stack of windows via a call to wn_openw.
  2323.                                                        wn_openw 
  2324.           
  2325.           1         The window, lst_ptr->handle, is brought to the top of
  2326.                                          ______                          
  2327.                                 lst ptr-                                 
  2328.                                          ______                          
  2329.                     the stack of windows via a call to q_open.  q_open is
  2330.                                                        q open   q open   
  2331.                     faster than wn_openw but no windowing functions which
  2332.                                 wn openw                                 
  2333.                     disrupt the order of display (wn_closew, wn_openw, or
  2334.                                                   wn closew  wn openw    
  2335.                     wn_activew) should be called without first removing the
  2336.                     wn activew                                             
  2337.                     window by a call to q_close.  This mode is used in pull
  2338.                                         q close                            
  2339.                     down menus for example because it is designed in a way
  2340.                     that makes certain that the window is closed on exit.
  2341.           
  2342.           2         Only the virtual screen is refreshed.  The changes are
  2343.                     not updated on the physical screen.
  2344.           
  2345.           These data structures members may be effected by lst_display
  2346.           (Note: in the following listing TILE is defined as
  2347.                                           TILE              
  2348.           window[lst_ptr->handle]->tiles[lst_ptr->tile_handle] and WDW is
  2349.                  ___ ____                ___ ____                        
  2350.           window          handle   tiles          tile handle      WDW   
  2351.                  ___ ____                ___ ____                        
  2352.           defined as window[lst_ptr->handle]):
  2353.                             ___ ____          
  2354.                      window          handle   
  2355.                             ___ ____          
  2356.           
  2357.           lst_ptr->optlen               The length of the longest string in
  2358.           ___ ____                                                         
  2359.                    optlen                                                  
  2360.           ___ ____                                                         
  2361.                                         the list of options.
  2362.           
  2363.           lst_ptr->taglen               The length of the longest on/off
  2364.           ___ ____                                                      
  2365.                    taglen                                               
  2366.           ___ ____                                                      
  2367.                                         tag (displayed to the left of each
  2368.                                         option in the list.
  2369.           
  2370.           lst_ptr->numopts              The number of options in the list.
  2371.           ___ ____                                                        
  2372.                    numopts                                                
  2373.           ___ ____                                                        
  2374.           
  2375.           TILE->virtual_screen          If (TILE->vs_rows *
  2376.           TILE- virtual screen              TILE- vs rows  
  2377.                                         TILE->vs_columns) >
  2378.                                         TILE- vs columns   
  2379.                                         (lst_ptr->numopts *
  2380.                                          ___ ____          
  2381.                                                   numopts  
  2382.                                          ___ ____          
  2383.                                         (lst_ptr->taglen +
  2384.                                          ___ ____         
  2385.                                                   taglen  
  2386.                                          ___ ____         
  2387.                                         lst_ptr->optlen)) then
  2388.                                         ___ ____              
  2389.                                                  optlen       
  2390.                                         ___ ____              
  2391.                                         TILE->virtual_screen is deallocated
  2392.                                         TILE- virtual screen               
  2393.  
  2394.  
  2395.  
  2396.                                        - 29 -
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.           DialogPro v 2.1                                       Users Guide
  2403.                                                            Reference Manual
  2404.  
  2405.  
  2406.                                         and a larger memory block is
  2407.                                         allocated.  TILE->virtual_screen
  2408.                                                     TILE- virtual screen
  2409.                                         then points to the new memory
  2410.                                         block.
  2411.           
  2412.           TILE->vs_rows, 
  2413.           TILE- vs rows  
  2414.           TILE->vs_columns              If TILE->vs_rows does not equal
  2415.           TILE- vs columns                 TILE- vs rows               
  2416.                                         lst_ptr->numopts or
  2417.                                         ___ ____           
  2418.                                                  numopts   
  2419.                                         ___ ____           
  2420.                                         TILE->vs_columns does not equal
  2421.                                         TILE- vs columns               
  2422.                                         (lst_ptr->optlen + lst_ptr->taglen)
  2423.                                          ___ ____          ___ ____        
  2424.                                                   optlen            taglen 
  2425.                                          ___ ____          ___ ____        
  2426.                                         then TILE->vs_columns is set equal
  2427.                                              TILE- vs columns             
  2428.                                         to lst_ptr->optlen +
  2429.                                            ___ ____         
  2430.                                                     optlen  
  2431.                                            ___ ____         
  2432.                                         lst_ptr->taglen and TILE->vs_rows
  2433.                                         ___ ____                         
  2434.                                                  taglen     TILE- vs rows
  2435.                                         ___ ____                         
  2436.                                         is calculated based on the size of
  2437.                                         the memory block pointed to by
  2438.                                         TILE->virtual_screen.
  2439.                                         TILE- virtual screen 
  2440.           
  2441.           WDW->port_columns             If lst_ptr->auto_horiz is TRUE and
  2442.                                            ___ ____                       
  2443.           WDW- port columns                         auto horiz    TRUE    
  2444.                                            ___ ____                       
  2445.                                         lst_ptr->optlen + lst_ptr->taglen
  2446.                                         ___ ____          ___ ____       
  2447.                                                  optlen            taglen
  2448.                                         ___ ____          ___ ____       
  2449.                                         does not equal WDW->port_columns,
  2450.                                                        WDW- port columns 
  2451.                                         WDW->port_columns is set equal to
  2452.                                         WDW- port columns                
  2453.                                         lst_ptr->optlen + lst_ptr->taglen.
  2454.                                         ___ ____          ___ ____        
  2455.                                                  optlen            taglen 
  2456.                                         ___ ____          ___ ____        
  2457.            
  2458.           WDW->port_rows                If lst_ptr->auto_vert is TRUE and
  2459.                                            ___ ____                      
  2460.           WDW- port rows                            auto vert    TRUE    
  2461.                                            ___ ____                      
  2462.                                         lst_ptr->numopts does not equal
  2463.                                         ___ ____                       
  2464.                                                  numopts               
  2465.                                         ___ ____                       
  2466.                                         WDW->port_rows, WDW->port_rows is
  2467.                                         WDW- port rows  WDW- port rows   
  2468.                                         set equal to lst_ptr->numopts.
  2469.                                                      ___ ____         
  2470.                                                               numopts 
  2471.                                                      ___ ____         
  2472.            
  2473.           
  2474.           If the list is not changed this function operates quickly.  If
  2475.           the list is larger than the previous list lst_display must free
  2476.                                                     lst display          
  2477.           the original virtual screen and allocate memory for the new
  2478.           virtual screen.  This can make for a small hiccup when opening a
  2479.           modified list.  You can get around this hiccup by calling
  2480.           lst_display with mode equal to 0 after modifying the list at a
  2481.           point where processing speed is less critical.  When lst_display
  2482.                                                                lst display
  2483.           is called (probably via lst_run) for actual display the user will
  2484.                                   lst run                                  
  2485.           not notice any delay.
  2486.           
  2487.           
  2488.           c. Return Value
  2489.           
  2490.           See section Standard Return Values.
  2491.           
  2492.           
  2493.           14. lst_displayitem
  2494.           
  2495.           a. Summary
  2496.           
  2497.           #include "dbpro.h"
  2498.           #include "dbpro.h"
  2499.           
  2500.           int lst_displayitem(list_ptr, offset)
  2501.                               ________  ______ 
  2502.           int lst_displayitem                  
  2503.                               ________  ______ 
  2504.           
  2505.           list_rec *list_ptr;
  2506.                     ________ 
  2507.           list_rec *         
  2508.                     ________ 
  2509.  
  2510.  
  2511.  
  2512.                                        - 30 -
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.           DialogPro v 2.1                                       Users Guide
  2519.                                                            Reference Manual
  2520.  
  2521.  
  2522.           int offset;
  2523.               ______ 
  2524.           int        
  2525.               ______ 
  2526.           
  2527.           
  2528.           b. Description
  2529.           
  2530.           Refreshes the display of the offset item (the first item is 0) in
  2531.                                        ______                              
  2532.           the list list_ptr.
  2533.                    ________ 
  2534.           
  2535.           If offset is greater than the number of items in the list
  2536.              ______                                                
  2537.           (list_ptr->numopts) then a blank line is output at that row in
  2538.            _________                                                    
  2539.                    ->numopts                                            
  2540.            _________                                                    
  2541.           the virtual screen.
  2542.           
  2543.           If offset is greater than the last row in the virtual screen
  2544.              ______                                                   
  2545.           an OUT_OF_RANGE error is returned.
  2546.              OUT_OF_RANGE                   
  2547.           
  2548.           
  2549.           c. Return Value
  2550.           
  2551.           See section Standard Return Values.
  2552.           
  2553.           
  2554.           15. lst_freestorage
  2555.           
  2556.           a. Summary
  2557.           
  2558.           #include "dbpro.h"
  2559.           #include "dbpro.h"
  2560.           
  2561.           int lst_freestorage(insurance)
  2562.                               _________ 
  2563.           int lst_freestorage(         )
  2564.                               _________ 
  2565.           
  2566.           lst_storage **insurance;
  2567.                         __________
  2568.           lst_storage **          
  2569.                         __________
  2570.           
  2571.           
  2572.           b. Description
  2573.           
  2574.           If *insurance does not equal NULL the data structure pointed to
  2575.              __________                                                  
  2576.                                        NULL                              
  2577.              __________                                                  
  2578.           by *insurance is freed and *insurance is set to NULL.
  2579.              __________              __________                
  2580.                                                           NULL 
  2581.              __________              __________                
  2582.           
  2583.           If *insurance is equal to NULL, nothing happens.
  2584.              __________                                   
  2585.                                     NULL                  
  2586.              __________                                   
  2587.           
  2588.           (Normally **insurance is the same as &(lst_ptr->insurance). 
  2589.                     ___________                  _______              
  2590.                                                &(       ->insurance)  
  2591.                     ___________                  _______              
  2592.           lst_ptr->insurance is used by lst_run to point to the previous
  2593.           _______                                                       
  2594.                  ->insurance            lst_run                         
  2595.           _______                                                       
  2596.           answers to the list.)
  2597.           
  2598.           
  2599.           c. Return Value
  2600.           
  2601.           See section Standard Return Values.
  2602.           
  2603.           
  2604.           16. lst_restoreanswers
  2605.           
  2606.           a. Summary
  2607.           
  2608.           #include "dbpro.h"
  2609.           #include "dbpro.h"
  2610.  
  2611.  
  2612.  
  2613.                                        - 31 -
  2614.  
  2615.  
  2616.  
  2617.  
  2618.  
  2619.           DialogPro v 2.1                                       Users Guide
  2620.                                                            Reference Manual
  2621.  
  2622.  
  2623.           
  2624.           int lst_restoreanswers(lst_ptr, insurance)
  2625.                                  _______  _________ 
  2626.           int lst_restoreanswers(       ,          )
  2627.                                  _______  _________ 
  2628.           
  2629.           lst_rec *lst_ptr;
  2630.                    ________
  2631.           lst_rec *        
  2632.                    ________
  2633.           lst_storage **insurance;
  2634.                         __________
  2635.           lst_storage **          
  2636.                         __________
  2637.           
  2638.           
  2639.           b. Description
  2640.           
  2641.           If *insurance is not equal to NULL the state of the lst, lst_ptr,
  2642.              __________                                            _______ 
  2643.                                         NULL                               
  2644.              __________                                            _______ 
  2645.           is changed to the answers recorded in the data structure of
  2646.           type lst_storage pointed to by *insurance.  The lst_storage data
  2647.                                          __________                       
  2648.                lst_storage                                lst_storage     
  2649.                                          __________                       
  2650.           structure is freed and *insurance is set to NULL.
  2651.                                                       NULL 
  2652.           
  2653.           If insurance is equal to NULL, nothing happens.
  2654.              _________                                   
  2655.                                    NULL                  
  2656.              _________                                   
  2657.           
  2658.           (Normally **insurance is the same as &(lst_ptr->insurance). 
  2659.                     ___________                  _______              
  2660.                                                &(       ->insurance)  
  2661.                     ___________                  _______              
  2662.           lst_ptr->insurance is used by lst_run to point to the previous
  2663.           _______                                                       
  2664.                  ->insurance            lst_run                         
  2665.           _______                                                       
  2666.           answers to the list.)
  2667.           
  2668.           
  2669.           
  2670.           c. Return Value
  2671.           
  2672.           See section Standard Return Values.
  2673.           
  2674.           
  2675.           17. lst_run
  2676.           
  2677.           a. Summary
  2678.           
  2679.           #include "dbpro.h"
  2680.           #include "dbpro.h"
  2681.           
  2682.           int lst_run(lst_ptr, message)
  2683.                       _______  _______ 
  2684.           int lst_run(       , message)
  2685.                       _______  _______ 
  2686.           
  2687.           list_rec *lst_ptr;
  2688.                     ________
  2689.           list_rec *        
  2690.                     ________
  2691.           unsigned int message;
  2692.                        ________
  2693.           unsigned int         
  2694.                        ________
  2695.           
  2696.           
  2697.           b. Description
  2698.           
  2699.           The function lst_run executes the messages in the message queue
  2700.                        lst_run                                           
  2701.           pointed to by db_queue against the data structure lst_ptr.  (It
  2702.                                                             _______      
  2703.                         db_queue                                         
  2704.                                                             _______      
  2705.           is very important that a message queue have been initialized via
  2706.           a call to db_switchqueue before calling lst_run.)
  2707.                     db switchqueue                lst run  
  2708.           
  2709.           Before executing the message queue it first places the standard
  2710.           message STORAGE at the tail of the queue and then it places
  2711.                   STORAGE                                            
  2712.           message at the head of the queue.  All messages are retrieved
  2713.           from the tail of the queue.  Each retrieved message is checked
  2714.           first against the global macro list, global macros, and then
  2715.           against the local macro list lst_ptr->macros.  If the message is
  2716.                                        _______                            
  2717.                                               ->macros                    
  2718.                                        _______                            
  2719.           a macro it is expanded by placing the items pointed to by the
  2720.           macro at the tail of the queue in reverse order.
  2721.  
  2722.  
  2723.  
  2724.                                        - 32 -
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.           DialogPro v 2.1                                       Users Guide
  2731.                                                            Reference Manual
  2732.  
  2733.  
  2734.           
  2735.           If there are no messages in the message queue lst_run polls the
  2736.                                                         lst_run          
  2737.           keyboard and mouse (if one is recognized when wn_init is
  2738.                                                         wn init   
  2739.           called.)  When activity is noted the keyboard/mouse activity is
  2740.           translated into a message and placed at the tail of the queue.
  2741.           
  2742.           If it is a mouse event the message MOUSE_EVENT is placed at the
  2743.                                              MOUSE_EVENT                 
  2744.           tail of the queue.  The MOUSE_EVENT message takes the last mouse
  2745.                                   MOUSE_EVENT                             
  2746.           event, translates it into a keystroke and places it at the tail
  2747.           of the queue.
  2748.           
  2749.           If the message has a value greater than 256 it is compared
  2750.           against the keystroke-command table, lst_ptr->cmds. If the
  2751.           keystroke is in the table it is interpreted into a standard
  2752.           event.  
  2753.           
  2754.           If the message is less than 256 it is interpreted as a standard
  2755.           message.  Otherwise it is compared against the the shortcut key
  2756.           of each of the options, starting at the current item + 1 and
  2757.           ending at the current item.  The first item whose shortcut key
  2758.           matches the keystroke is selected.   If lst_ptr->alpha_confirm is
  2759.           TRUE and lst_ptr->list_type is CHECKLIST then the item is toggles
  2760.           on/off.  If lst_ptr->alpha_confirm is TRUE and lst_ptr->list_type
  2761.           is SELECT_ONE then the item is set to TRUE and lst_run exits with
  2762.           a value of CONFIRMED.
  2763.           
  2764.           When one of several exit type messages is received lst_run
  2765.           terminates.
  2766.           
  2767.           The actual message selection/interpretation code explains it a
  2768.           little more succinctly:
  2769.           
  2770.           do {
  2771.           
  2772.                /* get event from queue */
  2773.                if (!NO_EVENT) event = db_pop();                       
  2774.           
  2775.                /* or from keyboard/mouse */
  2776.                else event = get_lstevent(lst_ptr);
  2777.           
  2778.           } while
  2779.                
  2780.                /* expand macros */
  2781.                (db_executemacros(event, lst_ptr->macros));
  2782.           
  2783.           /* if event > 256 see if attached to a standard message */
  2784.           if (event > 256) {
  2785.                event = lst_opcode(list_ptr, event);
  2786.                ascii = event % 256;
  2787.           }
  2788.           
  2789.           EXECUTE MESSAGE where:
  2790.           
  2791.                               message < 256, standard message,
  2792.  
  2793.  
  2794.  
  2795.                                        - 33 -
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.           DialogPro v 2.1                                       Users Guide
  2802.                                                            Reference Manual
  2803.  
  2804.  
  2805.                               message > 256, short cut selection.
  2806.           
  2807.           
  2808.           
  2809.           c. Return Value
  2810.           
  2811.           See section Standard Return Values.
  2812.           
  2813.           
  2814.           18. lst_select
  2815.           
  2816.           a. Summary
  2817.           
  2818.           #include "dbpro.h"
  2819.           #include "dbpro.h"
  2820.           
  2821.           int lst_select(list_ptr, offset)
  2822.                          ____ ___  ______ 
  2823.           int lst select                  
  2824.                          ____ ___  ______ 
  2825.           
  2826.           list_rec *list_ptr;
  2827.                     ____ ___ 
  2828.           list rec           
  2829.                     ____ ___ 
  2830.           int offset;
  2831.               ______ 
  2832.           int        
  2833.               ______ 
  2834.           
  2835.           
  2836.           b. Description
  2837.           
  2838.           Dehighlights the currently selected item and highlights the item
  2839.           offset items above (-) or below (+) relative to the current item.
  2840.           ______                                                           
  2841.           
  2842.           Accounts for rollover.
  2843.           
  2844.           Does nothing if offset is equal to 0.
  2845.                           ______               
  2846.           
  2847.           
  2848.           c. Return Value
  2849.           
  2850.           See section Standard Return Values.
  2851.           
  2852.           
  2853.           19. lst_storeanswers
  2854.           
  2855.           a. Summary
  2856.           
  2857.           #include "dbpro.h"
  2858.           #include "dbpro.h"
  2859.           
  2860.           int lst_storeanswers(lst_ptr, insurance)
  2861.                                _______  _________ 
  2862.           int lst_storeanswers(       ,          )
  2863.                                _______  _________ 
  2864.           
  2865.           list_rec *lst_ptr;
  2866.                     ________
  2867.           list_rec *        
  2868.                     ________
  2869.           lst_storage **insurance;
  2870.                         __________
  2871.           lst_storage **          
  2872.                         __________
  2873.           
  2874.           
  2875.           b. Description
  2876.           
  2877.           If *insurance is equal to NULL the state of the list, db_ptr, is
  2878.              __________                                         ______    
  2879.                                     NULL                                  
  2880.              __________                                         ______    
  2881.           stored in an interim data structure of type lst_storage and
  2882.                                                       lst_storage    
  2883.           *insurance returns the pointer to the data structure.
  2884.           __________                                           
  2885.           
  2886.  
  2887.  
  2888.  
  2889.                                        - 34 -
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.           DialogPro v 2.1                                       Users Guide
  2896.                                                            Reference Manual
  2897.  
  2898.  
  2899.           If insurance is not equal to NULL, nothing happens.
  2900.              _________                                       
  2901.                                        NULL                  
  2902.              _________                                       
  2903.           
  2904.           (Normally **insurance is the same as &(lst_ptr->insurance). 
  2905.                     ___________                  _______              
  2906.                                                &(       ->insurance)  
  2907.                     ___________                  _______              
  2908.           lst_ptr->insurance is used by lst_run to point to the previous
  2909.           _______                                                       
  2910.                  ->insurance            lst_run                         
  2911.           _______                                                       
  2912.           answers to the list.)
  2913.           
  2914.           
  2915.           c. Return Value
  2916.           
  2917.           See section Standard Return Values.
  2918.           
  2919.           
  2920.           20. lst_toggle
  2921.           
  2922.           a. Summary
  2923.           
  2924.           #include "dbpro.h"
  2925.           #include "dbpro.h"
  2926.           
  2927.           int lst_toggle(list_ptr, item)
  2928.                          ____ ___  ____ 
  2929.           int lst toggle                
  2930.                          ____ ___  ____ 
  2931.           
  2932.           list_rec *list_ptr;
  2933.                     ____ ___ 
  2934.           list rec           
  2935.                     ____ ___ 
  2936.           int item;
  2937.               ____ 
  2938.           int      
  2939.               ____ 
  2940.           
  2941.           
  2942.           b. Description
  2943.           
  2944.           If lst_ptr->lst_type is equal to CHECKLIST toggles the value of
  2945.              ___ ____                                                    
  2946.                       lst type             CHECKLIST                     
  2947.              ___ ____                                                    
  2948.           lst_ptr->selections[item] between TRUE and FALSE and refreshes
  2949.           ___ ____            ____                                      
  2950.                    selections               TRUE     FALSE              
  2951.           ___ ____            ____                                      
  2952.           the display of item by calling lst_displayitem.
  2953.                                          lst displayitem 
  2954.           
  2955.           If lst_ptr->lst_type is equal to SELECT_ONE all other items in
  2956.              ___ ____                                                   
  2957.                       lst type             SELECT ONE                   
  2958.              ___ ____                                                   
  2959.           the list are set to FALSE, lst_ptr->selections[item] is set to
  2960.                                      ___ ____            ____           
  2961.                               FALSE           selections                
  2962.                                      ___ ____            ____           
  2963.           TRUE, and the entire list is refreshed.
  2964.           TRUE                                   
  2965.           
  2966.           The value of lst_ptr->available[item] must be TRUE.
  2967.                        ___ ____           ____               
  2968.                                 available               TRUE 
  2969.                        ___ ____           ____               
  2970.           
  2971.           
  2972.           c. Return Value
  2973.           
  2974.           FALSE     If lst_ptr->available[item] is FALSE the function
  2975.                        ___ ____           ____                       
  2976.           FALSE                 available          FALSE             
  2977.                        ___ ____           ____                       
  2978.                     terminates early and returns FALSE.
  2979.                                                  FALSE 
  2980.           
  2981.           TRUE      function executed properly.
  2982.           TRUE                                 
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.  
  2996.  
  2997.                                        - 35 -
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.           DialogPro v 2.1                                       Users Guide
  3004.                                                            Reference Manual
  3005.  
  3006.  
  3007.           C. Standard Return Values
  3008.           
  3009.           ABORTED                  User exited by abort
  3010.           
  3011.           CONFIRMED                User exited by confirm
  3012.           
  3013.           ASCENDED                 User exited by ascending
  3014.           
  3015.           DESCENDED                User exited by descending
  3016.           
  3017.           MOUSED                   User exited by clicking the mouse
  3018.                                    outside of the image of the window
  3019.                                    associated with the dialog box.
  3020.           
  3021.           MENUED                   User exited by confirming a pull down
  3022.                                    menu
  3023.           
  3024.           OK                       No errors detected
  3025.           
  3026.           INVALID_QUESTION_TYPE    Dialog box's question list has a
  3027.                                    question of a type not defined in
  3028.                                    dbpro.h
  3029.           
  3030.           BAD_PARAMS               Coordinates or variables were outside of
  3031.                                    a specified range
  3032.           
  3033.           NULL_POINTER             Passed a NULL pointer
  3034.           
  3035.           OUT_OF_MEMORY            Function could not allocate enough
  3036.                                    memory to create required data
  3037.                                    structures
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.                                        - 36 -
  3065.  
  3066.  
  3067.  
  3068.  
  3069.  
  3070.           DialogPro v 2.1                                       Users Guide
  3071.                                                            Reference Manual
  3072.  
  3073.  
  3074.           D. Data structures
  3075.           
  3076.           1.  button
  3077.           
  3078.           char question_type            must be set to BUTTON.
  3079.                ________ ____                                  
  3080.           char                                         BUTTON 
  3081.                ________ ____                                  
  3082.           
  3083.           unsigned char tile_handle     The question is displayed in this
  3084.                         ____ ______                                      
  3085.           unsigned char                                                  
  3086.                         ____ ______                                      
  3087.                                         tile.  tile_handle must be a valid
  3088.                                                ____ ______                
  3089.                                         tile handle.
  3090.           
  3091.           int (*whenon)
  3092.                 ______ 
  3093.           int          
  3094.                 ______ 
  3095.               (dialog_box *)
  3096.                dialog box   
  3097.           int (*whenoff)
  3098.                 _______ 
  3099.           int           
  3100.                 _______ 
  3101.               (dialog_box *)
  3102.                dialog box   
  3103.           int (*action)(dialog_box *)   Pointers to edit checking
  3104.                 ______                                           
  3105.           int           dialog box                               
  3106.                 ______                                           
  3107.                                         routines.  db_run executes each
  3108.                                                    db run              
  3109.                                         routine under these conditions.  On
  3110.                                         selecting the question whenon is
  3111.                                                                ______   
  3112.                                         executed.  On selecting a question
  3113.                                         other than the current question or
  3114.                                         on exiting db_run whenoff is
  3115.                                                           _______   
  3116.                                                    db run           
  3117.                                                           _______   
  3118.                                         executed.  On pressing the
  3119.                                         button action is executed.  whenoff
  3120.                                                ______                      
  3121.                                         must return TRUE or the attempt to
  3122.                                                     TRUE                  
  3123.                                         navigate to another question will
  3124.                                         fail.  If any routine is set to
  3125.                                         NULL it is not executed.  db_run
  3126.                                         NULL                            
  3127.                                         always passes the current dialog
  3128.                                         box pointer to each edit checking
  3129.                                         function.
  3130.           
  3131.           char *statement               A string representing the statement
  3132.                 _________                                                  
  3133.           char                                                             
  3134.                 _________                                                  
  3135.                                         to appear inside the button.
  3136.           
  3137.           int statementx, statementy    Upper left coordinate of the
  3138.               __________  __________                                
  3139.           int                                                       
  3140.               __________  __________                                
  3141.                                         button.
  3142.           
  3143.           int key                       Identical to keybind (below), but
  3144.               ___                                                        
  3145.           int                                                            
  3146.               ___                                                        
  3147.                                         the button also becomes the
  3148.                                         selected question.
  3149.           
  3150.           char *boxchars                Box drawing characters to be used
  3151.                 ________                                                 
  3152.           char                                                           
  3153.                 ________                                                 
  3154.                                         in drawing the button border.  Use
  3155.                                         NULL to indicate no borders.  See
  3156.                                         NULL                             
  3157.                                         vs_box in The WindowPro reference
  3158.                                         vs box                           
  3159.                                         manual for further explanation.
  3160.           
  3161.           char shading                  Shading style to be used when
  3162.                _______                                               
  3163.           char                                                       
  3164.                _______                                               
  3165.                                         drawing the box surrounding the
  3166.                                         button.  See vs_box in The
  3167.                                                      vs box       
  3168.                                         WindowPro reference manual for
  3169.                                         further explanation.
  3170.           
  3171.  
  3172.  
  3173.  
  3174.  
  3175.                                        - 37 -
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.           DialogPro v 2.1                                       Users Guide
  3182.                                                            Reference Manual
  3183.  
  3184.  
  3185.           int cmdkey                    On pressing a button this value is
  3186.               ______                                                      
  3187.           int                                                             
  3188.               ______                                                      
  3189.                                         placed at the tail of the message
  3190.                                         queue.
  3191.           
  3192.           int keybind                   This value binds the keyboard code,
  3193.               _______                                                      
  3194.           int                                                              
  3195.               _______                                                      
  3196.                                         keybind, to the button.  Generating
  3197.                                         _______                            
  3198.                                         this keyboard code will 1-flash the
  3199.                                         button, 2-place cmdkey at the tail
  3200.                                                         ______            
  3201.                                         of the message queue, and 3-execute
  3202.                                         action.  Note that the selected
  3203.                                         ______                         
  3204.                                         question is not effected.
  3205.           
  3206.           char continuous               If TRUE, holding the mouse cursor
  3207.                __________                                                
  3208.           char                             TRUE                          
  3209.                __________                                                
  3210.                                         on the button repeatedly places
  3211.                                         PRESS_BUTTON at the tail of the
  3212.                                         PRESS BUTTON                   
  3213.                                         message queue.  If FALSE only a
  3214.                                                            FALSE       
  3215.                                         mouse release will place a single
  3216.                                         PRESS_BUTTON at the tail of the
  3217.                                         PRESS BUTTON                   
  3218.                                         message queue.
  3219.           
  3220.           int exitval                   If cmdkey results in exiting
  3221.               _______                      ______                   
  3222.           int                                                       
  3223.               _______                      ______                   
  3224.                                         db_run.  db_run will exit with the
  3225.                                         db run   db run                   
  3226.                                         value exitval.
  3227.                                               _______ 
  3228.           
  3229.           
  3230.           2.  db_colors
  3231.           
  3232.           db_colors represents the attributes to be used when updating a
  3233.           dialog box.  Typically you would set up one db_colors structure
  3234.           for use with all dialog boxes to establish a personality for your
  3235.           system.  You may also want to have various color schemes for
  3236.           different types of dialog boxes.
  3237.           
  3238.                
  3239.           unsigned char title_bg, 
  3240.                         __________
  3241.           unsigned char           
  3242.                         __________
  3243.           title_fg                      The background and foreground color
  3244.           ______________________________                                   
  3245.                                         to use when updating a title.
  3246.           
  3247.           unsigned char question_bg,
  3248.                         ____________
  3249.           unsigned char             
  3250.                         ____________
  3251.           question_fg                   The background and foreground color
  3252.           ______________________________                                   
  3253.                                         to use when updating the statement
  3254.                                         portions of questions.
  3255.           
  3256.           unsigned char response_bg, 
  3257.                         _____________
  3258.           unsigned char              
  3259.                         _____________
  3260.           response_fg                   The background and foreground color
  3261.           ______________________________                                   
  3262.                                         to use when updating an unselected,
  3263.                                         available response.
  3264.           
  3265.           unsigned char un_bg, un_fg    The background and foreground color
  3266.                         ________________                                   
  3267.           unsigned char                                                    
  3268.                         ________________                                   
  3269.                                         to use when updating an unselected,
  3270.                                         unavailable response.
  3271.           
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.                                        - 38 -
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.           DialogPro v 2.1                                       Users Guide
  3284.                                                            Reference Manual
  3285.  
  3286.  
  3287.           unsigned char sun_bg, sun_fg  The background and foreground color
  3288.                         ______________                                     
  3289.           unsigned char                                                    
  3290.                         ______________                                     
  3291.                                         to use when updating a selected,
  3292.                                         unavailable response.
  3293.           
  3294.           unsigned char select_bg,      
  3295.                        ____________     
  3296.           unsigned char                 
  3297.                        ____________     
  3298.           select_fg                     The background and foreground color
  3299.           ______________________________                                   
  3300.                                         to use when updating a selected,
  3301.                                         available response.
  3302.           
  3303.           unsigned char key_bg, key_fg  The background and foreground color
  3304.                        ________________                                    
  3305.           unsigned char                                                    
  3306.                        ________________                                    
  3307.                                         to use when updating a statement or
  3308.                                         list element.  Each character
  3309.                                         preceded by a ~ in a statement or
  3310.                                         list element is output in this
  3311.                                         color.  If there are no ~s in the
  3312.                                         string the first character is
  3313.                                         output with this color.  Used to
  3314.                                         indicate the shortcut keys for a
  3315.                                         question.
  3316.           
  3317.           unsigned char edit_bg, 
  3318.                        __________
  3319.           unsigned char          
  3320.                        __________
  3321.           edit_fg                       The background and foreground color
  3322.           _______                                                          
  3323.                                         to use when using the line editor
  3324.                                         in a free_form or reducer.
  3325.           
  3326.           
  3327.           3.  db_delimiters
  3328.           
  3329.           db_delimiters represents the characters to be placed around the
  3330.           response portion of questions within a dialog box.  Typically you
  3331.           would set up one db_delimiters structure for use with all dialog
  3332.           boxes to establish a personality for your system.  You may also
  3333.           want to have various delimiter schemes for different types of
  3334.           dialog boxes.
  3335.           
  3336.                
  3337.           
  3338.           unsigned char *ff_boxchars    The characters to place around the
  3339.                          ___________                                      
  3340.           unsigned char                                                   
  3341.                          ___________                                      
  3342.                                         response portion of a free_form
  3343.                                                               free_form
  3344.                                         question.  These character arrays
  3345.                                         are defined the same as the window
  3346.                                         border character arrays.  Note that
  3347.                                         any NULL characters are simply not
  3348.                                             NULL                          
  3349.                                         output.  This means that you do not
  3350.                                         have to triple space questions as
  3351.                                         you would by putting a complete box
  3352.                                         around each, but could just define
  3353.                                         delimiters on either side (as in
  3354.                                         DBPRO 1.1) or even none at all.
  3355.           
  3356.           unsigned char *mc_boxchars    Same as ff_boxchars, but for
  3357.                          ___________            ___________         
  3358.           unsigned char                                             
  3359.                          ___________            ___________         
  3360.                                         multi_choice questions.
  3361.           
  3362.  
  3363.  
  3364.  
  3365.  
  3366.                                        - 39 -
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.           DialogPro v 2.1                                       Users Guide
  3373.                                                            Reference Manual
  3374.  
  3375.  
  3376.           unsigned char *r_boxchars     Same as ff_boxchars, but for
  3377.                          __________             ___________         
  3378.           unsigned char                                             
  3379.                          __________             ___________         
  3380.                                         reducer questions.
  3381.           
  3382.           char *check_on, *check_off    The characters to be placed to the
  3383.                 ________   _________                                      
  3384.           char                                                            
  3385.                 ________   _________                                      
  3386.                                         left of a checkbox statement
  3387.                                         indicating that the item is checked
  3388.                                         or not checked, e.g. [ ] or [X].
  3389.           
  3390.           char *radio_on, *radio_off    Same as check_on, check_off but for
  3391.                 ________   _________                                       
  3392.           char                                                             
  3393.                 ________   _________                                       
  3394.                                         radio buttons.
  3395.           
  3396.           
  3397.           
  3398.           4.  dialog_box
  3399.           
  3400.           dialog_box is the basic data type used by almost all of the high
  3401.           ______ ___                                                      
  3402.           level functions.  The dialog box data structure consists of the
  3403.           following members.
  3404.           
  3405.           int handle                    Every dialog box must be related to
  3406.               ______                                                       
  3407.           int                                                              
  3408.               ______                                                       
  3409.                                         an existing window.  If handle is
  3410.                                                                 ______   
  3411.                                         not a valid window handle a window
  3412.                                                                           
  3413.                                         handle is created using the window
  3414.                                         information at the end of this
  3415.                                         structure.
  3416.           
  3417.           (*post_size)(void *)          after db_run processes any sizing
  3418.             ____ ____                                                    
  3419.                        void                   db run                     
  3420.             ____ ____                                                    
  3421.                                         messages it executes post_size
  3422.                                                              ____ ____
  3423.                                         passing db_ptr as argument.
  3424.           
  3425.           int (*post_move)(void *)      after db_run processes any moving
  3426.                 ____ ____                                                
  3427.           int              void               db run                     
  3428.                 ____ ____                                                
  3429.                                         messages it executes post_move
  3430.                                                              ____ ____
  3431.                                         passing db_ptr as argument.
  3432.           
  3433.           char move_ok                  db_run will not process any moving
  3434.                ____ __                                                    
  3435.           char                          db run                            
  3436.                ____ __                                                    
  3437.                                         messages if move_ok is FALSE.
  3438.                                                     ____ __          
  3439.                                                                FALSE 
  3440.                                                     ____ __          
  3441.           
  3442.           char size_ok                  db_run will not process any sizing
  3443.                ____ __                                                    
  3444.           char                          db run                            
  3445.                ____ __                                                    
  3446.                                         messages if size_ok is FALSE.
  3447.                                                     ____ __          
  3448.                                                                FALSE 
  3449.                                                     ____ __          
  3450.           
  3451.           void **questions              pointer to an array representing
  3452.                  _________                                              
  3453.                                         the list of questions which
  3454.                                         comprise the dialog box.  The last
  3455.                                         item in the array must be a NULL
  3456.                                         pointer.
  3457.           
  3458.           char *available               pointer to an array corresponding
  3459.                 _________                                                
  3460.           char                                                           
  3461.                 _________                                                
  3462.                                         to the above array, where a value
  3463.                                         of FALSE indicates that the
  3464.                                         response to the corresponding
  3465.                                         question cannot be modified.
  3466.           
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.                                        - 40 -
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.           DialogPro v 2.1                                       Users Guide
  3479.                                                            Reference Manual
  3480.  
  3481.  
  3482.           char id_select                The currently selected question as
  3483.                __ ______                                                  
  3484.           char                                                            
  3485.                __ ______                                                  
  3486.                                         an offset in the question array
  3487.                                         (questions, above.)
  3488.                                          _________         
  3489.           
  3490.           int *cmds                     An array of extended keyboard codes
  3491.                ____                                                        
  3492.           int                                                              
  3493.                ____                                                        
  3494.                                         corresponding to the standard
  3495.                                         messages, where standard message 1
  3496.                                         (PRESS_BUTTON) corresponds to
  3497.                                         keyboard code in position 0,
  3498.                                         message 2 (CONFIRM) corresponds to
  3499.                                         the keyboard code in position 1,
  3500.                                         etc.  This array is used to
  3501.                                         interpret keyboard codes into
  3502.                                         messages.  cmds is generally set to
  3503.                                                    ____                    
  3504.                                         the supplied default keyboard
  3505.                                         commands default_db_cmds.
  3506.                                                  default_db_cmds 
  3507.           
  3508.           char bg_operation             If FALSE, when db_run is executed
  3509.                __ _________                                              
  3510.           char                             FALSE       db run            
  3511.                __ _________                                              
  3512.                                         the dialog box window is brought to
  3513.                                         the top of the stack via a call to
  3514.                                         wn_openw.  If FALSE and the window
  3515.                                         wn openw      FALSE               
  3516.                                         is on the screen it remains in its
  3517.                                         position in the stack.  If FALSE
  3518.                                                                    FALSE
  3519.                                         and the window is not on the screen
  3520.                                         it is displayed via a call to
  3521.                                         wn_openw.  In a desktop type
  3522.                                         wn_openw                    
  3523.                                         application the desktop itself can
  3524.                                         be setup as a type of dialog box (a
  3525.                                         row of pull down menus along the
  3526.                                         top, with perhaps some buttons
  3527.                                         representing disk drives, etc.)  In
  3528.                                         this case we would not want the
  3529.                                         dialog box brought to the top of
  3530.                                         the stack since it would obscure
  3531.                                         all of the windows on the screen. 
  3532.                                         This type of dialog box would
  3533.                                         generally set bg_operation to TRUE.
  3534.                                                       __ _________         
  3535.                                                                       TRUE 
  3536.                                                       __ _________         
  3537.           
  3538.           storage *insurance            A pointer to a data structure
  3539.                    _________                                         
  3540.           storage                                                    
  3541.                    _________                                         
  3542.                                         representing the previous answers
  3543.                                         to the dialog box questions. 
  3544.                                         Always set this to NULL.
  3545.                                                            NULL 
  3546.           
  3547.           int **macros                  A list of macros associated with
  3548.                 ______                                                  
  3549.           int                                                           
  3550.                 ______                                                  
  3551.                                         this dialog box.  This array must
  3552.                                         be NULL terminated.  Each
  3553.                                            NULL                  
  3554.                                         individual macro must be
  3555.                                         constructed in this manner:
  3556.           
  3557.                                         [message to replace, number of
  3558.                                         replacement messages, nth
  3559.                                         replacement message,...., first
  3560.                                         replacement message]
  3561.           
  3562.  
  3563.  
  3564.  
  3565.                                        - 41 -
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.           DialogPro v 2.1                                       Users Guide
  3572.                                                            Reference Manual
  3573.  
  3574.  
  3575.                                         Note that the first item represents
  3576.                                         the message to be replaced, the
  3577.                                         second item represents the number
  3578.                                         of replacement items, and the
  3579.                                         succeeding items represent the
  3580.                                         messages to replace it with (note
  3581.                                         that these are in reverse order.
  3582.           
  3583.           db_colors *colors             Determines what attributes to use
  3584.                      ______                                              
  3585.           db_colors                                                      
  3586.                      ______                                              
  3587.                                         when displaying a dialog box.
  3588.           
  3589.           db_delimiters *delimiters     Determines what delimiters to place
  3590.                          __________                                        
  3591.           db_delimiters                                                    
  3592.                          __________                                        
  3593.                                         around various question types.
  3594.           
  3595.           if handle (above) is not a valid window handle we use this info
  3596.              ______                                                      
  3597.           to create a window ....
  3598.           
  3599.           unsigned virtual_rows         number of row & columns in the
  3600.                    ____________                                       
  3601.           unsigned                                                    
  3602.                    ____________                                       
  3603.           unsigned virtual_columns      virtual screen.
  3604.                    _______________                     
  3605.           unsigned                                     
  3606.                    _______________                     
  3607.           
  3608.           unsigned physical_x           location of the upper left hand
  3609.                    __________                                          
  3610.           unsigned                                                     
  3611.                    __________                                          
  3612.           unsigned physical_y           corner of the dialog box window.
  3613.                    __________                                           
  3614.           unsigned                                                      
  3615.                    __________                                           
  3616.           
  3617.           unsigned virtual_x, virtual_y upper left coordinate of the
  3618.                    ____________________                             
  3619.           unsigned                                                  
  3620.                    ____________________                             
  3621.                                         dialog box's virtual screen which
  3622.                                         maps to the upper left hand corner
  3623.                                         of the lists frame.
  3624.           
  3625.           unsigned port_rows            number of rows & columns within the
  3626.                    _________                                               
  3627.           unsigned                                                         
  3628.                    _________                                               
  3629.           unsigned port_columns         dialog box's frame
  3630.                    ____________                           
  3631.           unsigned                                        
  3632.                    ____________                           
  3633.           
  3634.           unsigned shading              style of shading to use for the
  3635.                    _______                                             
  3636.           unsigned                                                     
  3637.                    _______                                             
  3638.                                         dialog box's frame.  See The
  3639.                                         WindowPro manual for further
  3640.                                         explanation.
  3641.           
  3642.           char *name1, *name2           a string to place in the top &
  3643.                 _____   _____                                         
  3644.           char                                                        
  3645.                 _____   _____                                         
  3646.                                         bottom part or the dialog box's
  3647.                                         frame.
  3648.           
  3649.           unsigned char *boxchars       The characters to use when creating
  3650.                          ________                                          
  3651.           unsigned char                                                    
  3652.                          ________                                          
  3653.                                         the dialog box's frame.  See The
  3654.                                         WindowPro manual for further
  3655.                                         explanation
  3656.           
  3657.           unsigned char scroll_bars     The scroll bar style to use when
  3658.                         ___________                                     
  3659.           unsigned char                                                 
  3660.                         ___________                                     
  3661.                                         creating the dialog box's frame. 
  3662.                                         See The WindowPro manual for
  3663.                                         further explanation.
  3664.           
  3665.           
  3666.           
  3667.  
  3668.  
  3669.  
  3670.  
  3671.  
  3672.                                        - 42 -
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.           DialogPro v 2.1                                       Users Guide
  3679.                                                            Reference Manual
  3680.  
  3681.  
  3682.           5.  free_form
  3683.           
  3684.           char question_type            must be set to FREE_FORM
  3685.                ________ ____                                    
  3686.           char                                         FREE FORM
  3687.                ________ ____                                    
  3688.           
  3689.           unsigned char tile_handle     The question is displayed in this
  3690.                         ____ ______                                      
  3691.           unsigned char                                                  
  3692.                         ____ ______                                      
  3693.                                         tile.  tile_handle must be a valid
  3694.                                                ____ ______                
  3695.                                         tile handle.
  3696.           
  3697.           int (*whenon)
  3698.                 ______ 
  3699.           int          
  3700.                 ______ 
  3701.               (dialog_box *)
  3702.                dialog box   
  3703.           int (*whenoff)
  3704.                 _______ 
  3705.           int           
  3706.                 _______ 
  3707.               (dialog_box *)
  3708.                dialog box   
  3709.           int (*action)(dialog_box *)   Pointers to edit checking
  3710.                 ______                                           
  3711.           int           dialog box                               
  3712.                 ______                                           
  3713.                                         routines.  db_run executes each
  3714.                                                    db run              
  3715.                                         routine under these conditions.  On
  3716.                                         selecting the question whenon is
  3717.                                                                ______   
  3718.                                         executed.  On selecting a question
  3719.                                         other than the current question or
  3720.                                         on exiting db_run whenoff is
  3721.                                                           _______   
  3722.                                                    db run           
  3723.                                                           _______   
  3724.                                         executed.  On exiting the line
  3725.                                         editor action is executed.  action
  3726.                                                ______               ______
  3727.                                         must return TRUE or you will not be
  3728.                                                     TRUE                   
  3729.                                         able to exit the line editor.
  3730.                                         whenoff must return TRUE or the
  3731.                                         _______                        
  3732.                                                             TRUE       
  3733.                                         _______                        
  3734.                                         attempt to navigate to another
  3735.                                         question will fail.  If any routine
  3736.                                         is set to NULL it is not executed. 
  3737.                                                   NULL                     
  3738.                                         db_run always passes the current
  3739.                                         dialog box pointer to each edit
  3740.                                         checking function.
  3741.           
  3742.           char *statement               A string representing the statement
  3743.                 _________                                                  
  3744.           char                                                             
  3745.                 _________                                                  
  3746.                                         portion of the question.
  3747.           
  3748.           int statementx, statementy    The left coordinate of the
  3749.               __________  __________                              
  3750.           int                                                     
  3751.               __________  __________                              
  3752.                                         statement.
  3753.           
  3754.           int key                       Shortcut key.
  3755.               ___                                    
  3756.           int                                        
  3757.               ___                                    
  3758.           
  3759.           char *response                The current response to the
  3760.                 ________                                           
  3761.           char                                                     
  3762.                 ________                                           
  3763.                                         question.  This must be a
  3764.                                         dynamically allocated string.  On
  3765.                                         confirming a new response this
  3766.                                         response will be freed.
  3767.           
  3768.           char *default_response        If response is NULL when the line
  3769.                                         editor is invoked, or the response
  3770.                                         is displayed, response will be set
  3771.                                         equal to a dynamically allocated
  3772.                                         copy of this string.
  3773.           
  3774.           int responsex, responsey      The coordinate where the response
  3775.               _________  _________                                       
  3776.           int                                                            
  3777.               _________  _________                                       
  3778.                                         will be displayed.
  3779.           
  3780.  
  3781.  
  3782.  
  3783.                                        - 43 -
  3784.  
  3785.  
  3786.  
  3787.  
  3788.  
  3789.           DialogPro v 2.1                                       Users Guide
  3790.                                                            Reference Manual
  3791.  
  3792.  
  3793.           int responselen               The maximum displayed length of the
  3794.               ___________                                                  
  3795.           int                                                              
  3796.               ___________                                                  
  3797.                                         response.  The actual length of the
  3798.                                         response can be up to 1000
  3799.                                         characters.
  3800.           
  3801.           char *storage                 The previous response to the
  3802.                 _______                                             
  3803.           char                                                      
  3804.                 _______                                             
  3805.                                         question.  Should always be set
  3806.                                         to NULL.
  3807.                                            NULL 
  3808.           
  3809.           char **target                 The char * pointer pointed to by
  3810.                  ______                                                 
  3811.           char                                                          
  3812.                  ______                                                 
  3813.                                         target is updated with the value of
  3814.                                         ______                             
  3815.                                         response on exiting the db_run.
  3816.                                         ________                       
  3817.                                                                 db run 
  3818.                                         ________                       
  3819.           
  3820.           int cursor_position           The position of the cursor on
  3821.               ______ ________                                        
  3822.           int                                                        
  3823.               ______ ________                                        
  3824.                                         confirming the current response to
  3825.                                         the question.
  3826.           
  3827.           int **macros                  See dialog_box for further
  3828.                 ______                                            
  3829.           int                               dialog box            
  3830.                 ______                                            
  3831.                                         explanation.
  3832.           
  3833.           char refresh                  If TRUE the statement and question
  3834.                _______                                                    
  3835.           char                                                            
  3836.                _______                                                    
  3837.                                         delimiters are output.  Set this to
  3838.                                         true on initialization.  Each time
  3839.                                         the statement and delimiters are
  3840.                                         displayed this value is reset to
  3841.                                         FALSE.
  3842.           
  3843.           
  3844.           6.  list
  3845.           
  3846.           unsigned char tile_handle     The question is displayed in this
  3847.                         ____ ______                                      
  3848.           unsigned char                                                  
  3849.                         ____ ______                                      
  3850.                                         tile.  tile_handle must be a valid
  3851.                                                ____ ______                
  3852.                                         tile handle.
  3853.           
  3854.           int (*whenon)
  3855.                 ______ 
  3856.           int          
  3857.                 ______ 
  3858.               (dialog_box *)
  3859.                dialog box   
  3860.           int (*whenoff)
  3861.                 _______ 
  3862.           int           
  3863.                 _______ 
  3864.               (dialog_box *)
  3865.                dialog box   
  3866.           int (*action)(dialog_box *)   Pointers to edit checking
  3867.                 ______                                           
  3868.           int           dialog box                               
  3869.                 ______                                           
  3870.                                         routines.  db_run executes each
  3871.                                                    db run              
  3872.                                         routine under these conditions.  On
  3873.                                         selecting the question whenon is
  3874.                                                                ______   
  3875.                                         executed.  On selecting a question
  3876.                                         other than the current question or
  3877.                                         on exiting db_run whenoff is
  3878.                                                           _______   
  3879.                                                    db run           
  3880.                                                           _______   
  3881.                                         executed.  On exiting the list
  3882.                                         action is executed.  Until action
  3883.                                         ______                     ______
  3884.                                         returns TRUE the user will be
  3885.                                                 TRUE                 
  3886.                                         unable to exit the list.  whenoff
  3887.                                                                   _______
  3888.                                         must return TRUE or the attempt to
  3889.                                                     TRUE                  
  3890.                                         navigate to another question will
  3891.                                         fail.  If any routine is set to
  3892.                                         NULL it is not executed.  db_run
  3893.                                         NULL                            
  3894.  
  3895.  
  3896.  
  3897.  
  3898.                                        - 44 -
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.           DialogPro v 2.1                                       Users Guide
  3905.                                                            Reference Manual
  3906.  
  3907.  
  3908.                                         always passes the current dialog
  3909.                                         box pointer to each edit checking
  3910.                                         function.
  3911.           
  3912.           char *statement               A string representing the statement
  3913.                 _________                                                  
  3914.           char                                                             
  3915.                 _________                                                  
  3916.                                         portion of the question.
  3917.           
  3918.           int statementx, statementy    The left coordinate of the
  3919.               __________  __________                              
  3920.           int                                                     
  3921.               __________  __________                              
  3922.                                         statement.
  3923.           
  3924.           int key                       Shortcut key.
  3925.               ___                                    
  3926.           int                                        
  3927.               ___                                    
  3928.           
  3929.           unsigned int handle           A window handle.  The window should
  3930.                        ______                                              
  3931.           unsigned int                                                     
  3932.                        ______                                              
  3933.                                         have the number of rows and columns
  3934.                                         and appropriate border type and
  3935.                                         style as desired for the scrolling
  3936.                                         list box.  If this is not a valid
  3937.                                         window handle.  The window will be
  3938.                                         created using the window parameters
  3939.                                         below.
  3940.           
  3941.           if handle (above) is not a valid window handle we use this info
  3942.              ______                                                      
  3943.           to create a window ....
  3944.           
  3945.           unsigned virtual_rows         number of row & columns in the
  3946.                    ____________                                       
  3947.           unsigned                                                    
  3948.                    ____________                                       
  3949.           unsigned virtual_columns      virtual screen.
  3950.                    _______________                     
  3951.           unsigned                                     
  3952.                    _______________                     
  3953.           
  3954.           unsigned physical_x           location of the upper left hand
  3955.                    __________                                          
  3956.           unsigned                                                     
  3957.                    __________                                          
  3958.           unsigned physical_y           corner of the list within the
  3959.                    __________                                        
  3960.           unsigned                                                   
  3961.                    __________                                        
  3962.                                         dialog box window.
  3963.           
  3964.           unsigned virtual_x            upper left coordinate of the list's
  3965.                    _________                                               
  3966.           unsigned                                                         
  3967.                    _________                                               
  3968.           unsigned virtual_y            virtual screen which maps to the
  3969.                    _________                                            
  3970.           unsigned                                                      
  3971.                    _________                                            
  3972.                                         upper left hand corner of the lists
  3973.                                         frame.
  3974.           
  3975.           unsigned port_rows            number of rows & columns within the
  3976.                    _________                                               
  3977.           unsigned                                                         
  3978.                    _________                                               
  3979.           unsigned port_columns         list's frame
  3980.                    ____________                     
  3981.           unsigned                                  
  3982.                    ____________                     
  3983.           
  3984.           unsigned shading              style of shading to use for the
  3985.                    _______                                             
  3986.           unsigned                                                     
  3987.                    _______                                             
  3988.                                         list's frame.  See The WindowPro
  3989.                                         manual for further explanation.
  3990.           
  3991.           char *name1, *name2           a string to place in the top &
  3992.                 _____   _____                                         
  3993.           char                                                        
  3994.                 _____   _____                                         
  3995.                                         bottom part or the list's frame.
  3996.           
  3997.           unsigned char *boxchars       The characters to use when creating
  3998.                          ________                                          
  3999.           unsigned char                                                    
  4000.                          ________                                          
  4001.                                         the list's frame.  See The
  4002.                                         WindowPro manual for further
  4003.                                         explanation
  4004.           
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010.  
  4011.                                        - 45 -
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.           DialogPro v 2.1                                       Users Guide
  4018.                                                            Reference Manual
  4019.  
  4020.  
  4021.           unsigned char scroll_bars     The scroll bar style to use when
  4022.                         ___________                                     
  4023.           unsigned char                                                 
  4024.                         ___________                                     
  4025.                                         creating the list's frame.  See The
  4026.                                         WindowPro manual for further
  4027.                                         explanation.
  4028.           
  4029.           Note : If handle is a valid window handle than you do not need to
  4030.                     ______                                                 
  4031.           set the above structure members to meaningful values.
  4032.           
  4033.           char list_type                Set this to SELECT_ONE for a radio
  4034.                ____ ____                                                  
  4035.           char                                      SELECT ONE            
  4036.                ____ ____                                                  
  4037.                                         buttons style list.  Set this to
  4038.                                         CHECKLIST to toggle more than one
  4039.                                         CHECKLIST                        
  4040.                                         item on and off.
  4041.           
  4042.           char **options                An array of strings representing
  4043.                  _______                                                
  4044.           char                                                          
  4045.                  _______                                                
  4046.                                         the items in the list.
  4047.           
  4048.           int offset                    An offset into the above array
  4049.               ______                                                  
  4050.           int                                                         
  4051.               ______                                                  
  4052.                                         representing the currently selected
  4053.                                         item.
  4054.           
  4055.           char *selections              An array of chars corresponding the
  4056.                 __________                                                 
  4057.           char                                                             
  4058.                 __________                                                 
  4059.                                         above array.  If selections[0] is
  4060.                                                          __________      
  4061.                                         TRUE indicates that the first item
  4062.                                         TRUE                              
  4063.                                         in the list is toggle on, If
  4064.                                         selections[1] is TRUE indicates
  4065.                                         __________                     
  4066.                                                          TRUE          
  4067.                                         __________                     
  4068.                                         that the second item in the list is
  4069.                                         toggled on.  selections[2] == 2
  4070.                                                   _____________        
  4071.                                         indicates that the third item
  4072.                                         represents a title within the list.
  4073.           
  4074.           char *available               pointer to an array corresponding
  4075.                 _________                                                
  4076.           char                                                           
  4077.                 _________                                                
  4078.                                         to the above array, where a value
  4079.                                         of FALSE indicates that the state
  4080.                                            FALSE                         
  4081.                                         of the corresponding item cannot be
  4082.                                         modified.
  4083.           
  4084.           char *on, *off                Strings which represent the on/off
  4085.                 __   ___                                                  
  4086.           char                                                            
  4087.                 __   ___                                                  
  4088.                                         states of each item in the list,
  4089.                                         e.g. "ON" and "OFF", or "XX" and
  4090.                                         "--", etc.
  4091.           
  4092.           list_rec *list_ptr            Used internally.  Set this to NULL.
  4093.                     ____ ___                                               
  4094.           list rec                                                    NULL 
  4095.                     ____ ___                                               
  4096.           
  4097.           char **target                 A pointer to an array of chars.  On
  4098.                  ______                                                    
  4099.           char                                                             
  4100.                  ______                                                    
  4101.                                         exiting db_run *target is set equal
  4102.                                                         ______             
  4103.                                                 db run                     
  4104.                                                         ______             
  4105.                                         to selections.
  4106.                                            __________ 
  4107.           
  4108.           int **macros                  See explanation at dialog_box.
  4109.                 ______                                                
  4110.           int                                              dialog box 
  4111.                 ______                                                
  4112.           
  4113.           
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.                                        - 46 -
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.           DialogPro v 2.1                                       Users Guide
  4128.                                                            Reference Manual
  4129.  
  4130.  
  4131.           7.  list_rec
  4132.           
  4133.           list_rec is the basic data type used by almost all of the high
  4134.           ________                                                      
  4135.           level list-oriented functions.  The list_rec data structure
  4136.                                               ________               
  4137.           consists of the following members.
  4138.           
  4139.           int handle                    Every list must be related to an
  4140.               ______                                                    
  4141.           int                                                           
  4142.               ______                                                    
  4143.                                         existing window.  handle must be a
  4144.                                                           ______          
  4145.                                         valid window handle.
  4146.           
  4147.           int tile_handle               Every list must be related to an
  4148.               ___________                                               
  4149.           int                                                           
  4150.               ___________                                               
  4151.                                         existing tile.  tile_handle must be
  4152.                                                         ___________        
  4153.                                         a valid tile handle.
  4154.           
  4155.           char list_type                Set to CHECKLIST to allow more than
  4156.                _________________________                                   
  4157.           char                                 CHECKLIST                   
  4158.                _________________________                                   
  4159.                                         one item to be toggled on/off.  Set
  4160.                                         to SELECT_ONE so that as one item
  4161.                                            SELECT ONE                    
  4162.                                         is toggled on all other items are
  4163.                                         toggled off.
  4164.           
  4165.           char move_ok                  lst_run will not process any moving
  4166.                ____ __                                                     
  4167.           char                          lst run                            
  4168.                ____ __                                                     
  4169.                                         messages if move_ok is FALSE.
  4170.                                                     ____ __          
  4171.                                                                FALSE 
  4172.                                                     ____ __          
  4173.           
  4174.           char size_ok                  lst_run will not process any sizing
  4175.                ____ __                                                     
  4176.           char                          lst run                            
  4177.                ____ __                                                     
  4178.                                         messages if size_ok is FALSE.
  4179.                                                     ____ __          
  4180.                                                                FALSE 
  4181.                                                     ____ __          
  4182.           
  4183.           char auto_vert                If TRUE, on calling lst_run the
  4184.                ____ ____                                               
  4185.           char                             TRUE             lst run    
  4186.                ____ ____                                               
  4187.                                         window is automatically resized so
  4188.                                         that it has the same number of rows
  4189.                                         as there are items in the list.
  4190.           
  4191.           char auto_horiz               If TRUE, on calling lst_run the
  4192.                ____ _____                                              
  4193.           char                             TRUE             lst run    
  4194.                ____ _____                                              
  4195.                                         window is automatically resized so
  4196.                                         that it is as wide as the widest
  4197.                                         option.
  4198.           
  4199.           char alpha_confirm            If TRUE, list_type is SELECT_ONE,
  4200.                _____ _______                     ____ ____               
  4201.           char                             TRUE               SELECT ONE 
  4202.                _____ _______                     ____ ____               
  4203.                                         and executing lst_run,  pressing
  4204.                                                       lst run           
  4205.                                         any alpha selects the next item
  4206.                                         bound to the key, toggles it on,
  4207.                                         and exits lst_run with a value of
  4208.                                                   lst run                
  4209.                                         CONFIRMED.
  4210.                                         CONFIRMED 
  4211.           
  4212.                                         If TRUE, list_type is CHECKLIST,
  4213.                                            TRUE               CHECKLIST 
  4214.                                         and executing lst_run, pressing any
  4215.                                                       lst run              
  4216.                                         alpha key selects the next item in
  4217.                                         the list bound to that key and
  4218.                                         toggles the item on.
  4219.           
  4220.           int *cmds                     An array of extended keyboard codes
  4221.                ____                                                        
  4222.           int                                                              
  4223.                ____                                                        
  4224.                                         corresponding to the standard
  4225.                                         messages, where standard message 1
  4226.                                         (PRESS_BUTTON) corresponds to
  4227.                                         keyboard code in position 0,
  4228.  
  4229.  
  4230.  
  4231.                                        - 47 -
  4232.  
  4233.  
  4234.  
  4235.  
  4236.  
  4237.           DialogPro v 2.1                                       Users Guide
  4238.                                                            Reference Manual
  4239.  
  4240.  
  4241.                                         message 2 (CONFIRM) corresponds to
  4242.                                         the keyboard code in position 1,
  4243.                                         etc.  This array is used to
  4244.                                         interpret keyboard codes into
  4245.                                         messages.  cmds is generally set to
  4246.                                                    ____                    
  4247.                                         the default keyboard commands
  4248.                                         default_db_cmds.
  4249.                                         default_db_cmds 
  4250.           
  4251.           char bg_operation             If FALSE, when db_run is executed
  4252.                __ _________                                              
  4253.           char                             FALSE       db run            
  4254.                __ _________                                              
  4255.                                         the dialog box window is brought to
  4256.                                         the top of the stack via a call to
  4257.                                         wn_openw.  If FALSE and the window
  4258.                                         wn openw      FALSE               
  4259.                                         is on the screen it remains in its
  4260.                                         position in the stack.  If FALSE
  4261.                                                                    FALSE
  4262.                                         and the window is not on the screen
  4263.                                         it is displayed via a call to
  4264.                                         wn_openw.  In a desktop type
  4265.                                         application the desktop itself can
  4266.                                         be setup as a type of dialog box (a
  4267.                                         row of pull down menus along the
  4268.                                         top, with perhaps some buttons
  4269.                                         representing disk drives, etc.)  In
  4270.                                         this case we would not want the
  4271.                                         dialog box brought to the top of
  4272.                                         the stack since it would obscure
  4273.                                         all of the windows on the screen. 
  4274.                                         This type of dialog box would
  4275.                                         generally set bg_operation to TRUE.
  4276.                                                       __ _________         
  4277.                                                                       TRUE 
  4278.                                                       __ _________         
  4279.           
  4280.           lst_storage *insurance        A pointer to a data structure
  4281.                        _________                                     
  4282.           lst_storage                                                
  4283.                        _________                                     
  4284.                                         representing the previous answers
  4285.                                         to the list.  Always set this to
  4286.                                         NULL.
  4287.                                         NULL 
  4288.           
  4289.           int **macros                  A list of macros associated with
  4290.                 ______                                                  
  4291.           int                                                           
  4292.                 ______                                                  
  4293.                                         this dialog box.  The list must be
  4294.                                         NULL terminated (i.e. the last item
  4295.                                         NULL                               
  4296.                                         in the array must be NULL.)  Each
  4297.                                                              NULL        
  4298.                                         individual macro must be
  4299.                                         constructed in this manner:
  4300.           
  4301.                                         [message to replace, nth
  4302.                                         message,...., first message, NULL]
  4303.                                                                      NULL 
  4304.           
  4305.                                         Note that the first item represents
  4306.                                         the message to be replaced, the
  4307.                                         succeeding items represent the
  4308.                                         messages to replace it with (note
  4309.                                         that these are in reverse order,)
  4310.                                         and the last item must be a NULL.
  4311.                                                                     NULL 
  4312.           
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.                                        - 48 -
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.           DialogPro v 2.1                                       Users Guide
  4326.                                                            Reference Manual
  4327.  
  4328.  
  4329.           char *on, *off                Strings which represent the on/off
  4330.                 __   ___                                                  
  4331.           char                                                            
  4332.                 __   ___                                                  
  4333.                                         states of each item in the list,
  4334.                                         e.g. "ON" and "OFF", or "XX" and
  4335.                                         "--", etc.
  4336.           
  4337.           char **options                An array of strings representing
  4338.                  _______                                                
  4339.           char                                                          
  4340.                  _______                                                
  4341.                                         the items in the list.  The last
  4342.                                         element in the array must be NULL.
  4343.                                                                      NULL 
  4344.           
  4345.           char *selections              An array of chars corresponding the
  4346.                 __________                                                 
  4347.           char                                                             
  4348.                 __________                                                 
  4349.                                         above array.  If selections[0] is
  4350.                                                          __________      
  4351.                                         TRUE indicates that the first item
  4352.                                         TRUE                              
  4353.                                         in the list is toggle on, If
  4354.                                         selections[1] is TRUE indicates
  4355.                                         __________                     
  4356.                                                          TRUE          
  4357.                                         __________                     
  4358.                                         that the second item in the list is
  4359.                                         toggled on, etc.
  4360.           
  4361.           char *available               pointer to an array corresponding
  4362.                 _________                                                
  4363.           char                                                           
  4364.                 _________                                                
  4365.                                         to the above array, where a value
  4366.                                         of FALSE indicates that the state
  4367.                                            FALSE                         
  4368.                                         of the corresponding item cannot be
  4369.                                         modified.
  4370.           
  4371.           unsigned *keybind             An array of ints corresponding to
  4372.                     _______                                              
  4373.           unsigned                                                       
  4374.                     _______                                              
  4375.                                         the above array where each element
  4376.                                         in the array represents an extended
  4377.                                         keyboard code or an ascii code. 
  4378.                                         These values bind the options to
  4379.                                         keystrokes (see alpha_confirm,
  4380.                                                         _____ _______ 
  4381.                                         above, for further explanation.) 
  4382.                                         If an ascii code is used selection
  4383.                                         in case insensitive.  If an
  4384.                                         extended keyboard code is used it
  4385.                                         must match exactly.
  4386.           
  4387.           int selected                  An offset into the above array
  4388.               ________                                                
  4389.           int                                                         
  4390.               ________                                                
  4391.                                         representing the item in the list
  4392.                                         which is currently selected.
  4393.           
  4394.           int                           These values are used internally
  4395.           int                                                           
  4396.                                         and should not be modified.  You
  4397.                                         may however read these variables
  4398.                                         although they are not always
  4399.                                         guaranteed to be up to date.
  4400.           
  4401.           
  4402.           optlen,                       The length of the longest option in
  4403.           ______                                                           
  4404.                                         the list.
  4405.           
  4406.           taglen,                       The length of the longest on/off
  4407.           ______                                                        
  4408.                                         indicator.
  4409.           
  4410.           numopts                       The number of items in the list.
  4411.           _______                                                       
  4412.           
  4413.  
  4414.  
  4415.  
  4416.                                        - 49 -
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.           DialogPro v 2.1                                       Users Guide
  4423.                                                            Reference Manual
  4424.  
  4425.  
  4426.           db_colors *colors             A pointer to a color scheme
  4427.                      ______                                        
  4428.           db_colors                                                
  4429.                      ______                                        
  4430.                                         structure.  Determines which
  4431.                                         attributes to use when displaying
  4432.                                         different parts of the list.
  4433.           
  4434.           unsigned maxcols              determines the number of columns in
  4435.                    _______                                                 
  4436.           unsigned                                                         
  4437.                    _______                                                 
  4438.                                         the list.  If this number is larger
  4439.                                         than the number of items in the
  4440.                                         list, creates a vertical list, like
  4441.                                         a lotus menu.
  4442.           
  4443.           unsigned                      If handle (above) is not a valid
  4444.                                            ______                       
  4445.           unsigned                                                      
  4446.                                            ______                       
  4447.                                         window handle these items are used
  4448.                                         to create a window for the list.
  4449.           
  4450.                physical_x, physical_y
  4451.           ___________________________
  4452.                virtual_x, virtual_y,
  4453.           __________________________
  4454.                virtual_rows,
  4455.           __________________
  4456.                virtual_columns
  4457.           ____________________
  4458.                port_rows, port_columns
  4459.           ____________________________
  4460.                shading
  4461.           ____________
  4462.           
  4463.           char *name1, *name2
  4464.                 _____   _____
  4465.           char               
  4466.                 _____   _____
  4467.           char unsigned *boxchars;
  4468.                          ________ 
  4469.           char unsigned           
  4470.                          ________ 
  4471.           
  4472.           
  4473.           8.  multi_choice
  4474.           
  4475.           char question_type            must be set to MULTI_CHOICE.
  4476.                ________ ____                                        
  4477.           char                                         MULTI CHOICE 
  4478.                ________ ____                                        
  4479.           
  4480.           unsigned char tile_handle     The question is displayed in this
  4481.                         ____ ______                                      
  4482.           unsigned char                                                  
  4483.                         ____ ______                                      
  4484.                                         tile.  tile_handle must be a valid
  4485.                                                ____ ______                
  4486.                                         tile handle.
  4487.           
  4488.           int (*whenon)
  4489.           int          
  4490.               (dialog_box *)
  4491.                dialog box   
  4492.           int (*whenoff)
  4493.           int           
  4494.               (dialog_box *)
  4495.                dialog box   
  4496.           int (*action)(dialog_box *)   Pointers to edit checking
  4497.                 ______                                           
  4498.           int           dialog box                               
  4499.                 ______                                           
  4500.                                         routines.  db_run executes each
  4501.                                                    db run              
  4502.                                         routine under these conditions.  On
  4503.                                         selecting the question whenon is
  4504.                                         executed.  On selecting a question
  4505.                                         other than the current question or
  4506.                                         on exiting the db_run whenoff is
  4507.                                                               _______   
  4508.                                                        db run           
  4509.                                                               _______   
  4510.                                         executed.  On confirming the
  4511.                                         response to the current
  4512.                                         question action is executed. 
  4513.                                                  ______              
  4514.                                         whenoff must return TRUE or the
  4515.                                                             TRUE       
  4516.                                         attempt to navigate to another
  4517.                                         question will fail.  If any routine
  4518.                                         is set to NULL it is not executed. 
  4519.                                                   NULL                     
  4520.  
  4521.  
  4522.  
  4523.  
  4524.  
  4525.                                        - 50 -
  4526.  
  4527.  
  4528.  
  4529.  
  4530.  
  4531.           DialogPro v 2.1                                       Users Guide
  4532.                                                            Reference Manual
  4533.  
  4534.  
  4535.                                         db_run always passes the current
  4536.                                         dialog box pointer to each edit
  4537.                                         checking function.
  4538.           
  4539.           char *statement               A string representing the statement
  4540.                 _________                                                  
  4541.           char                                                             
  4542.                 _________                                                  
  4543.                                         portion of the question.
  4544.           
  4545.           int statementx, statementy    Displays the statement portion of
  4546.               __________  __________                                     
  4547.           int                                                            
  4548.               __________  __________                                     
  4549.                                         the question at these coordinates.
  4550.           
  4551.           char *response_mask           If not set to NULL, db_run
  4552.                 ________ ____                                     
  4553.           char                                        NULL  db run
  4554.                 ________ ____                                     
  4555.                                         suppresses the display of statement
  4556.                                         and puts this string in place of
  4557.                                         the response.  Makes multiple
  4558.                                         choice question behave like a pull
  4559.                                         down menu.
  4560.           
  4561.           char **response_list          An array of strings representing
  4562.                  ________ ____                                          
  4563.           char                                                          
  4564.                  ________ ____                                          
  4565.                                         the available choices in the
  4566.                                         multiple choice question.  The last
  4567.                                         element in the array must be set to
  4568.                                         NULL.
  4569.                                         NULL 
  4570.           
  4571.           char *available               An array of chars corresponding to
  4572.                 _________                                                 
  4573.           char                                                            
  4574.                 _________                                                 
  4575.                                         the above array. If available[0] is
  4576.                                                             _________      
  4577.                                         FALSE the first item cannot be
  4578.                                         FALSE                         
  4579.                                         chosen as the response, If
  4580.                                         available[1] is TRUE the second
  4581.                                         _________                      
  4582.                                                         TRUE           
  4583.                                         _________                      
  4584.                                         item in response_list can be chosen
  4585.                                                 ________ ____              
  4586.                                         as the response. A 2 indicates that
  4587.                                         the list element is a title.
  4588.           
  4589.           int response_offset           The current response to the
  4590.               ________ ______                                      
  4591.           int                                                      
  4592.               ________ ______                                      
  4593.                                         question as an offset into
  4594.                                         response_list.
  4595.                                         ________ ____ 
  4596.           
  4597.           int responsex, responsey      The coordinates where the response
  4598.               _________  _________                                        
  4599.           int                                                             
  4600.               _________  _________                                        
  4601.                                         portion of the question is
  4602.                                         displayed.
  4603.           
  4604.           int responselen               The displayed length of the
  4605.               ___________                                          
  4606.           int                                                      
  4607.               ___________                                          
  4608.                                         response.  The actual response can
  4609.                                         be longer.
  4610.           
  4611.           int key                       The extended keyboard code for the
  4612.               ___                                                         
  4613.           int                                                             
  4614.               ___                                                         
  4615.                                         shortcut key (when executing
  4616.                                         db_run, if the user presses the
  4617.                                         db run                         
  4618.                                         shortcut key he navigates directly
  4619.                                         to associated question.)
  4620.           
  4621.           unsigned int aux_handle       A window handle.  Required for the
  4622.                        ___ ______                                         
  4623.           unsigned int                                                    
  4624.                        ___ ______                                         
  4625.                                         pull down list.  Note if this is
  4626.                                         not a valid window handle it will
  4627.                                         be automatically created.
  4628.  
  4629.  
  4630.  
  4631.                                        - 51 -
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.           DialogPro v 2.1                                       Users Guide
  4638.                                                            Reference Manual
  4639.  
  4640.  
  4641.           
  4642.           unsigned char aux_tile        A valid tile handle.  Required for
  4643.                         ___ ____                                          
  4644.           unsigned char                                                   
  4645.                         ___ ____                                          
  4646.                                         the pull down list.
  4647.           
  4648.           if aux_handle (above) is not a valid window handle this info to
  4649.              __________                                                  
  4650.           create a window ...
  4651.           
  4652.           unsigned char *boxchars       
  4653.                          ________       
  4654.           unsigned char                 
  4655.                          ________       
  4656.           char *major_head, *minor_head
  4657.                 __________   __________
  4658.           char                         
  4659.                 __________   __________
  4660.           char shading
  4661.                _______
  4662.           char        
  4663.                _______
  4664.           
  4665.           
  4666.           list_rec *list_ptr            Used internally.  Set this to NULL.
  4667.                     ____ ___                                               
  4668.           list rec                                                    NULL 
  4669.                     ____ ___                                               
  4670.           
  4671.           int *target                   A pointer to an int to set equal to
  4672.                ______                                                      
  4673.           int                                                              
  4674.                ______                                                      
  4675.                                         response_offset on exiting db_run.
  4676.                                         _______________                   
  4677.                                                                    db run 
  4678.                                         _______________                   
  4679.           
  4680.           int **macros                  See dialog_box for an explanation.
  4681.                 ______                                                    
  4682.           int                               dialog box                    
  4683.                 ______                                                    
  4684.           
  4685.           char refresh                  When this value is true and the
  4686.                _______                                                 
  4687.           char                                                         
  4688.                _______                                                 
  4689.                                         question is displayed the statement
  4690.                                         and delimiters are output to the
  4691.                                         dialog box's virtual screen. 
  4692.                                         Otherwise, just the response is
  4693.                                         sent.  Typically you initialize
  4694.                                         this to TRUE.  Every time the
  4695.                                                 TRUE                 
  4696.                                         question is displayed this is reset
  4697.                                         to FALSE.
  4698.                                            FALSE 
  4699.           
  4700.           unsigned maxcols              Indicates how many columns to use
  4701.                    _______                                               
  4702.           unsigned                                                       
  4703.                    _______                                               
  4704.                                         when displaying the pull down list.
  4705.           
  4706.           
  4707.           9.  rcbutton
  4708.           
  4709.           This structure is used to represent either a radio button or a
  4710.           check box.
  4711.           
  4712.           char question_type            must be set to RCBUTTON.
  4713.                ________ ____                                    
  4714.           char                                         RCBUTTON 
  4715.                ________ ____                                    
  4716.           
  4717.           unsigned char tile_handle     The question is displayed in this
  4718.                         ____ ______                                      
  4719.           unsigned char                                                  
  4720.                         ____ ______                                      
  4721.                                         tile.  tile_handle must be a valid
  4722.                                                ____ ______                
  4723.                                         tile handle.
  4724.           
  4725.           int (*whenon)
  4726.                 ______ 
  4727.           int          
  4728.                 ______ 
  4729.               (dialog_box *)
  4730.                dialog box   
  4731.           int (*whenoff)
  4732.                 _______ 
  4733.           int           
  4734.                 _______ 
  4735.               (dialog_box *)
  4736.                dialog box   
  4737.           int (*action)(dialog_box *)   Pointers to edit checking
  4738.                 ______                                           
  4739.           int           dialog box                               
  4740.                 ______                                           
  4741.                                         routines.  db_run executes each
  4742.                                                    db run              
  4743.                                         routine under these conditions.  On
  4744.                                         selecting the question whenon is
  4745.                                                                ______   
  4746.                                         executed.  On selecting a question
  4747.                                         other than the current question or
  4748.  
  4749.  
  4750.  
  4751.                                        - 52 -
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.           DialogPro v 2.1                                       Users Guide
  4758.                                                            Reference Manual
  4759.  
  4760.  
  4761.                                         on exiting db_run whenoff is
  4762.                                                           _______   
  4763.                                                    db run           
  4764.                                                           _______   
  4765.                                         executed.  On pressing the
  4766.                                         rcbutton action is executed. 
  4767.                                                  ______              
  4768.                                         whenoff must return TRUE or the
  4769.                                                             TRUE       
  4770.                                         attempt to navigate to another
  4771.                                         question will fail.  If any routine
  4772.                                         is set to NULL it is not executed. 
  4773.                                                   NULL                     
  4774.                                         db_run always passes the current
  4775.                                         dialog box pointer to each edit
  4776.                                         checking function.
  4777.           
  4778.           char *statement               A string representing the statement
  4779.                 _________                                                  
  4780.           char                                                             
  4781.                 _________                                                  
  4782.                                         to appear to the right of the
  4783.                                         rcbutton's checkoff area.
  4784.           
  4785.           int statementx, statementy    left coordinate of the rcbutton.
  4786.               __________  __________                                    
  4787.           int                                                           
  4788.               __________  __________                                    
  4789.           
  4790.           int key                       Shortcut key.
  4791.               ___                                    
  4792.           int                                        
  4793.               ___                                    
  4794.           
  4795.           unsigned char btype           Set to CHECK if a checkbox, or
  4796.                         _____                                         
  4797.           unsigned char                                               
  4798.                         _____                                         
  4799.                                         RADIO(N) where N is a number
  4800.                                         between 0 and 254.  Only one
  4801.                                         rcbutton in the radio group number
  4802.                                         N can be "on" at any moment.
  4803.           
  4804.           char checked                  Set to TRUE if the rcbutton is
  4805.                _________________________                              
  4806.           char                                                        
  4807.                _________________________                              
  4808.                                         checked.
  4809.           
  4810.           char *target                  The variable pointed to by target
  4811.                 ________________________                           ______
  4812.           char                                                           
  4813.                 ________________________                           ______
  4814.                                         will be updated with the value of
  4815.                                         checked on exiting the dialog box.
  4816.                                         _______                           
  4817.           
  4818.           
  4819.           10. reducer
  4820.           
  4821.           char question_type            must be set to REDUCER.
  4822.                ________ ____                                   
  4823.           char                                         REDUCER 
  4824.                ________ ____                                   
  4825.           
  4826.           unsigned char tile_handle     The question is displayed in this
  4827.                         ____ ______                                      
  4828.           unsigned char                                                  
  4829.                         ____ ______                                      
  4830.                                         tile.  tile_handle must be a valid
  4831.                                                ____ ______                
  4832.                                         tile handle.
  4833.           
  4834.           int (*whenon)
  4835.           int          
  4836.               (dialog_box *)
  4837.                dialog box   
  4838.           int (*whenoff)
  4839.           int           
  4840.               (dialog_box *)
  4841.                dialog box   
  4842.           int (*action)(dialog_box *)   Pointers to edit checking
  4843.                 ______                                           
  4844.           int           dialog box                               
  4845.                 ______                                           
  4846.                                         routines.  db_run executes each
  4847.                                                    db run              
  4848.                                         routine under these conditions.  On
  4849.                                         selecting the question whenon is
  4850.                                         executed.  On selecting a question
  4851.                                         other than the current question or
  4852.                                         on exiting the db_run whenoff is
  4853.                                                               _______   
  4854.                                                        db run           
  4855.                                                               _______   
  4856.                                         executed.  On confirming the
  4857.                                         response to the current
  4858.  
  4859.  
  4860.  
  4861.                                        - 53 -
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.           DialogPro v 2.1                                       Users Guide
  4868.                                                            Reference Manual
  4869.  
  4870.  
  4871.                                         question action is executed. 
  4872.                                                  ______              
  4873.                                         whenoff must return TRUE or the
  4874.                                                             TRUE       
  4875.                                         attempt to navigate to another
  4876.                                         question will fail.  If any routine
  4877.                                         is set to NULL it is not executed. 
  4878.                                                   NULL                     
  4879.                                         db_run always passes the current
  4880.                                         dialog box pointer to each edit
  4881.                                         checking function.
  4882.           
  4883.           char *statement               A string representing the statement
  4884.                 _________                                                  
  4885.           char                                                             
  4886.                 _________                                                  
  4887.                                         portion of the question.
  4888.           
  4889.           int statementx, statementy    Displays the statement portion of
  4890.               __________  __________                                     
  4891.           int                                                            
  4892.               __________  __________                                     
  4893.                                         the question at these coordinates.
  4894.           
  4895.           char **response_list          An array of strings representing
  4896.                  ________ ____                                          
  4897.           char                                                          
  4898.                  ________ ____                                          
  4899.                                         the available choices in the
  4900.                                         multiple choice question.  The last
  4901.                                         element in the array must be set to
  4902.                                         NULL.
  4903.                                         NULL 
  4904.           
  4905.           char *available               An array of chars corresponding to
  4906.                 _________                                                 
  4907.           char                                                            
  4908.                 _________                                                 
  4909.                                         the above array. If available[0] is
  4910.                                                             _________      
  4911.                                         FALSE the first item cannot be
  4912.                                         FALSE                         
  4913.                                         chosen as the response, If
  4914.                                         available[1] is TRUE the second
  4915.                                         _________                      
  4916.                                                         TRUE           
  4917.                                         _________                      
  4918.                                         item in response_list can be chosen
  4919.                                                 ________ ____              
  4920.                                         as the response, etc.
  4921.           
  4922.           char *response                The current response to the
  4923.                _________                                           
  4924.           char                                                     
  4925.                _________                                           
  4926.                                         question.  Must be a dynamically
  4927.                                         allocated string as when a new
  4928.                                         response is confirmed the previous
  4929.                                         response is freed.
  4930.           
  4931.           int responsex, responsey      The coordinates where the response
  4932.               _________  _________                                        
  4933.           int                                                             
  4934.               _________  _________                                        
  4935.                                         portion of the question is
  4936.                                         displayed.
  4937.           
  4938.           int responselen               The displayed length of the
  4939.               ___________                                          
  4940.           int                                                      
  4941.               ___________                                          
  4942.                                         response.  The actual response can
  4943.                                         be longer.
  4944.           
  4945.           int key                       The extended keyboard code for the
  4946.               ___                                                         
  4947.           int                                                             
  4948.               ___                                                         
  4949.                                         shortcut key (when executing
  4950.                                         db_run, if the user presses the
  4951.                                         db run                         
  4952.                                         shortcut key he navigates directly
  4953.                                         to associated question.)
  4954.           
  4955.           int cursor_position           The position of the cursor when the
  4956.               ______ ________                                              
  4957.           int                                                              
  4958.               ______ ________                                              
  4959.                                         current response was confirmed.
  4960.           
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.                                        - 54 -
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.           DialogPro v 2.1                                       Users Guide
  4973.                                                            Reference Manual
  4974.  
  4975.  
  4976.           char **target                 A pointer to a variable to set
  4977.                 _______                                               
  4978.           char                                                        
  4979.                 _______                                               
  4980.                                         equal to response on exiting
  4981.                                                  ________           
  4982.                                         db_run.
  4983.                                         db run 
  4984.           
  4985.           int **list_macros             Macros used while in the pull down
  4986.                 ___________                                               
  4987.           int                                                             
  4988.                 ___________                                               
  4989.                                         list portion of a reducer
  4990.                                         question.  See dialog_box for an
  4991.                                                        dialog box       
  4992.                                         explanation.
  4993.           
  4994.           int **edlin_macros            Macros used while in the lide
  4995.                 ____________                                         
  4996.           int                                                        
  4997.                 ____________                                         
  4998.                                         editor portion of a reducer
  4999.                                         question.  See dialog_box for an
  5000.                                                        dialog box       
  5001.                                         explanation.
  5002.           
  5003.           unsigned int aux_handle       A window handle.  Required for the
  5004.                        ___ ______                                         
  5005.           unsigned int                                                    
  5006.                        ___ ______                                         
  5007.                                         pull down list.  Note if this is
  5008.                                         not a valid window handle it will
  5009.                                         be automatically created.
  5010.           
  5011.           unsigned char aux_tile        A valid tile handle.  Required for
  5012.                         ___ ____                                          
  5013.           unsigned char                                                   
  5014.                         ___ ____                                          
  5015.                                         the pull down list.
  5016.           
  5017.           if aux_handle (above) is not a valid window handle this info to
  5018.              __________                                                  
  5019.           create a window ...
  5020.           
  5021.           unsigned char *boxchars       
  5022.                          ________       
  5023.           unsigned char                 
  5024.                          ________       
  5025.           char *major_head, *minor_head
  5026.                 __________   __________
  5027.           char                         
  5028.                 __________   __________
  5029.           char shading
  5030.                _______
  5031.           char        
  5032.                _______
  5033.           
  5034.           
  5035.           list_rec *list_ptr            Used internally.  Set this to NULL.
  5036.                     ____ ___                                               
  5037.           list rec                                                    NULL 
  5038.                     ____ ___                                               
  5039.           
  5040.           char refresh                  When this value is true and the
  5041.                _______                                                 
  5042.           char                                                         
  5043.                _______                                                 
  5044.                                         question is displayed the statement
  5045.                                         and delimiters are output to the
  5046.                                         dialog box's virtual screen. 
  5047.                                         Otherwise, just the response is
  5048.                                         sent.  Typically you initialize
  5049.                                         this to TRUE.  Every time the
  5050.                                                 TRUE                 
  5051.                                         question is displayed this is reset
  5052.                                         to FALSE.
  5053.                                            FALSE 
  5054.           
  5055.           unsigned maxcols              Indicates how many columns to use
  5056.                    _______                                               
  5057.           unsigned                                                       
  5058.                    _______                                               
  5059.                                         when displaying the pull down list.
  5060.           
  5061.           
  5062.           
  5063.           11. scroll_txt
  5064.           
  5065.           This data structure is used to define the scrolling text type
  5066.           questions.  This question type is different from the other
  5067.           question types because you must supply the address to the
  5068.           'controlling' function.  Two sample controlling functions are
  5069.           provided.
  5070.  
  5071.  
  5072.  
  5073.                                        - 55 -
  5074.  
  5075.  
  5076.  
  5077.  
  5078.  
  5079.           DialogPro v 2.1                                       Users Guide
  5080.                                                            Reference Manual
  5081.  
  5082.  
  5083.           
  5084.           char question_type            Must be set to SCROLL_TXT.
  5085.                _____________                                      
  5086.           char                                         SCROLL_TXT 
  5087.                _____________                                      
  5088.           
  5089.           unsigned char tile_handle     The question is displayed in this
  5090.                         ____ ______                                      
  5091.           unsigned char                                                  
  5092.                         ____ ______                                      
  5093.                                         tile.  tile_handle must be a valid
  5094.                                                ____ ______                
  5095.                                         tile handle.
  5096.           
  5097.           int (*whenon)
  5098.           int          
  5099.               (dialog_box *)
  5100.                dialog box   
  5101.           int (*whenoff)
  5102.           int           
  5103.               (dialog_box *)
  5104.                dialog box   
  5105.           int (*action)(dialog_box *)   Pointers to edit checking
  5106.                 ______                                           
  5107.           int           dialog box                               
  5108.                 ______                                           
  5109.                                         routines.  db_run executes each
  5110.                                                    db run              
  5111.                                         routine under these conditions.  On
  5112.                                         selecting the question whenon is
  5113.                                         executed.  On selecting a question
  5114.                                         other than the current question or
  5115.                                         on exiting the db_run whenoff is
  5116.                                                               _______   
  5117.                                                        db run           
  5118.                                                               _______   
  5119.                                         executed.  On confirming the
  5120.                                         response to the current
  5121.                                         question action is executed. 
  5122.                                                  ______              
  5123.                                         whenoff must return TRUE or the
  5124.                                                             TRUE       
  5125.                                         attempt to navigate to another
  5126.                                         question will fail.  If any routine
  5127.                                         is set to NULL it is not executed. 
  5128.                                                   NULL                     
  5129.                                         db_run always passes the current
  5130.                                         dialog box pointer to each edit
  5131.                                         checking function.
  5132.           
  5133.           int (far *control)
  5134.                     _______ 
  5135.           int  far          
  5136.                     _______ 
  5137.                (dialog_box *, int)      On executing the question control
  5138.                 dialog_box    int                                        
  5139.                                         is passed to this routine.  In the
  5140.                                         event of a MOUSE_EVENT occuring
  5141.                                                    MOUSE_EVENT         
  5142.                                         within the question's region the
  5143.                                         second parameter will be set to
  5144.                                         MOUSE_EVENT. Otherwise the
  5145.                                         MOUSE_EVENT               
  5146.                                         parameter will be 0.
  5147.           
  5148.           void *misc_ptr                Because the use of SCROLL_TXT is
  5149.                 ________                                                
  5150.           void                                             SCROLL_TXT   
  5151.                 ________                                                
  5152.                                         open-ended it may be necessary to
  5153.                                         associate additional data with the
  5154.                                         question.  You can point to a
  5155.                                         structure containing this
  5156.                                         additional data using this pointer.
  5157.           
  5158.           int boxx, boxy                The upper left corner of the
  5159.               ____  ____                                            
  5160.           int                                                       
  5161.               ____  ____                                            
  5162.                                         question will begin at this
  5163.                                         coordinate within the dialog box
  5164.                                         window.
  5165.           
  5166.           unsigned int aux_handle       The question requires a window for
  5167.                        __________                                         
  5168.           unsigned int                                                    
  5169.                        __________                                         
  5170.                                         some interim processing.  Create a
  5171.                                         window and assign the handle to
  5172.  
  5173.  
  5174.  
  5175.  
  5176.                                        - 56 -
  5177.  
  5178.  
  5179.  
  5180.  
  5181.  
  5182.           DialogPro v 2.1                                       Users Guide
  5183.                                                            Reference Manual
  5184.  
  5185.  
  5186.                                         this data structure member.  The
  5187.                                         question region will be same size
  5188.                                         as this window.
  5189.           
  5190.           int **macros                  See dialog_box for further
  5191.                 ______                                            
  5192.           int                               dialog box            
  5193.                 ______                                            
  5194.                                         explanation.
  5195.           
  5196.           
  5197.           
  5198.           12. title
  5199.           
  5200.           Use this to display titles in dialog boxes.
  5201.           
  5202.           char question_type            Must be set to TITLE.
  5203.                _________________________                     
  5204.           char                                         TITLE 
  5205.                _________________________                     
  5206.           
  5207.           unsigned char tile_handle     Indicates which tile to display the
  5208.                         ________________                                   
  5209.           unsigned char                                                    
  5210.                         ________________                                   
  5211.                                         title in.
  5212.           
  5213.           char *statement               Indicates the title string.
  5214.                 _________                                          
  5215.           char                                                     
  5216.                 _________                                          
  5217.           
  5218.           int statementx, statementy    Where to locate the title.
  5219.               __________________________                          
  5220.           int                                                     
  5221.               __________________________                          
  5222.           
  5223.           char center_justify           If TRUE ignores statementx and
  5224.                _________________________                __________    
  5225.           char                             TRUE                       
  5226.                _________________________                __________    
  5227.                                         center justifies the title within
  5228.                                         the virtual screen.
  5229.  
  5230.  
  5231.  
  5232.  
  5233.  
  5234.  
  5235.  
  5236.  
  5237.  
  5238.  
  5239.  
  5240.  
  5241.  
  5242.  
  5243.  
  5244.  
  5245.  
  5246.  
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.                                        - 57 -
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.           DialogPro v 2.1                                       Users Guide
  5268.                                                            Reference Manual
  5269.  
  5270.  
  5271.           E. Global variables
  5272.           
  5273.           1. db_head, db_tail, db_queue
  5274.           
  5275.           int *db_queue                 An array of ints representing the
  5276.                __ _____                                                  
  5277.           int                                                            
  5278.                __ _____                                                  
  5279.                                         circular message queue
  5280.           
  5281.           unsigned char *db_head        A pointer to a char containing the
  5282.                          __ ____                                          
  5283.           unsigned char                                                   
  5284.                          __ ____                                          
  5285.                                         offset into db_queue where the last
  5286.                                                     __ _____               
  5287.                                         message in the queue is located.
  5288.           
  5289.           unsigned char *db_tail        A pointer to a char containing the
  5290.                          __ ____                                          
  5291.           unsigned char                                                   
  5292.                          __ ____                                          
  5293.                                         offset into db_queue where the next
  5294.                                                     __ _____               
  5295.                                         message to be used is located.
  5296.           
  5297.           
  5298.           2. default_db_cmds
  5299.           
  5300.           A default keyboard-command table.
  5301.           
  5302.           
  5303.           3. idle
  5304.           
  5305.           void (* idle)(void *)
  5306.                   ____         
  5307.           void          void   
  5308.                   ____         
  5309.           
  5310.           the idle function is repeatedly called in the keyboard/mouse
  5311.           polling loop.  The function pointed to by idle is passed a
  5312.                                                     ____            
  5313.           pointer to the active dialog_box or list_rec on each call.  Use
  5314.                                 dialog_box    list_rec                   
  5315.           this to place time limits on a response, update a time and date
  5316.           field, or do other real time updating.  Note that the timing of
  5317.           the polling loop can vary based on whether keyboard typematic is
  5318.           active, the mouse buttons are up or down, or whether or not a
  5319.           mouse is installed.
  5320.           
  5321.           
  5322.           4. monitor_switch, _fg, _bg, _speed, _wdw, _tile
  5323.           
  5324.           These values determine how the debug monitor operates.  The debug
  5325.           monitor will display the queue events in a window.  You can watch
  5326.           these queue events to determine if a dialog box is behaving
  5327.           properly.
  5328.           
  5329.           extern unsigned int 
  5330.           extern unsigned int 
  5331.             monitor_wdw                 The handle of the window where the
  5332.             ___________                                                   
  5333.                                         debug info will be displayed.  The 
  5334.           extern unsigned char          
  5335.           extern unsigned char          
  5336.             monitor_tile                The tile handle where the debug
  5337.           ______________                                               
  5338.                                         info will be displayed.  This
  5339.                                         tile's virtual screen needs to be
  5340.                                         about 70 characters wide.
  5341.           
  5342.           extern int monitor_speed      0 = no delay, > 0 = more delay, -1
  5343.                      _____________                                        
  5344.           extern int                                                      
  5345.                      _____________                                        
  5346.                                         = step through by keystroke.
  5347.           
  5348.  
  5349.  
  5350.  
  5351.                                        - 58 -
  5352.  
  5353.  
  5354.  
  5355.  
  5356.  
  5357.           DialogPro v 2.1                                       Users Guide
  5358.                                                            Reference Manual
  5359.  
  5360.  
  5361.           extern int monitor_switch     0 if monitor is OFF, 1 if it is ON.
  5362.                      ______________                                        
  5363.           extern int                                                       
  5364.                      ______________                                        
  5365.           
  5366.           extern unsigned char 
  5367.           extern unsigned char 
  5368.             monitor_fg, monitor_bg      The background and foreground color
  5369.             __________  __________                                         
  5370.                                         that the monitor info will display
  5371.                                         in.
  5372.           
  5373.           
  5374.           
  5375.           5. mouse_sensitivity
  5376.           
  5377.           The timeout value to be used when calling kb_mouseclicks.  15
  5378.                                                     kb mouseclicks     
  5379.           seems to work just about right.  But you may want to fine tune it
  5380.           for other systems or give the user access to this value--like the
  5381.           MAC or Microsoft Windows.
  5382.  
  5383.  
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390.  
  5391.  
  5392.  
  5393.  
  5394.  
  5395.  
  5396.  
  5397.  
  5398.  
  5399.  
  5400.  
  5401.  
  5402.  
  5403.  
  5404.  
  5405.  
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.  
  5420.  
  5421.  
  5422.  
  5423.  
  5424.                                        - 59 -
  5425.  
  5426.  
  5427.  
  5428.  
  5429.  
  5430.           DialogPro v 2.1                                       Users Guide
  5431.                                                            Reference Manual
  5432.  
  5433.  
  5434.           F. Messages
  5435.           
  5436.           1. Dialog Box
  5437.           
  5438.           Each message is translated as follows at the dialog box level by
  5439.                                                 _______________________   
  5440.           db_run (several of the messages transfer porcessing to question
  5441.           level--to see how messages are interpreted at the question level
  5442.           review the following section):
  5443.           
  5444.           DO_NOTHING          Does nothing.
  5445.           DO_NOTHING                       
  5446.           
  5447.           PRESS_BUTTON        If the current question (indicated by
  5448.           PRESS_BUTTON                                             
  5449.                               db_ptr->id_select) is a button the value
  5450.                               ______                                  
  5451.                                     ->id_select                       
  5452.                               ______                                  
  5453.                               BUTTONQUEST(db_ptr->id_select)->cmd_key is
  5454.                                           ______                        
  5455.                               BUTTONQUEST(      ->id_select)->cmd_key   
  5456.                                           ______                        
  5457.                               placed at the tail of the queue and the
  5458.                               global variable button_press is set to
  5459.                               BUTTONQUEST(db_ptr->id_select)->exitval.
  5460.                                           ______                      
  5461.                               BUTTONQUEST(      ->id_select)->exitval 
  5462.                                           ______                      
  5463.           
  5464.                               If the current question is a multiple choice
  5465.                               question the current response + 1 (with wrap
  5466.                               around from the last response to the first)
  5467.                               becomes the new response.
  5468.           
  5469.                               On the other questions, nothing happens.
  5470.           
  5471.           CONFIRM             If the current question is a multiple choice
  5472.           CONFIRM                                                         
  5473.                               and CURRMC->response__mask does not equal
  5474.                                   CURRMC->response__mask               
  5475.                               NULL the message DESCEND is placed at the
  5476.                               NULL             DESCEND                 
  5477.                               tail of the queue.  
  5478.           
  5479.                               Otherwise, if at the dialog box level, it
  5480.                               executes db_freestorage.  Exits db_run with
  5481.                                        db_freestorage         db_run     
  5482.                               the value CONFIRMED and places CONFIRM at the
  5483.                                         CONFIRMED            CONFIRM       
  5484.                               tail of the queue if button_press is equal to
  5485.                                                    button_press            
  5486.                               0, otherwise it exits with the value of
  5487.                               button_press.
  5488.                               button_press 
  5489.           
  5490.           ABORT               Executes db_restoreanswers and exits db_run.
  5491.           ABORT                        db_restoreanswers           db_run 
  5492.                               Exits with the value ABORTED and places ABORT
  5493.                                                    ABORTED            ABORT
  5494.                               at the tail of the queue if button_press is
  5495.                                                           button_press   
  5496.                               equal to 0, otherwise it exits with the value
  5497.                               button_press.
  5498.                               button_press 
  5499.           
  5500.           UP, DOWN, LEFT, RIGHT, HOME, END, BIG_RIGHT, BIG_LEFT, BACKSPACE
  5501.           UP, DOWN, LEFT, RIGHT, HOME, END, BIG_RIGHT, BIG_LEFT, BACKSPACE
  5502.           
  5503.                               Passes the event onto the current question by
  5504.                               putting the respective event at the tail of
  5505.                               the queue and then placing a DESCEND at the
  5506.                               tail of the queue.  
  5507.           
  5508.                               In the case of a BUTTON the event is
  5509.                               ignored.  In the case of radio button selects
  5510.                               the next or previous radio button in the
  5511.                               radio button group.
  5512.  
  5513.  
  5514.  
  5515.                                        - 60 -
  5516.  
  5517.  
  5518.  
  5519.  
  5520.  
  5521.           DialogPro v 2.1                                       Users Guide
  5522.                                                            Reference Manual
  5523.  
  5524.  
  5525.           
  5526.           BIG_UP              Does nothing.
  5527.           BIG_UP                           
  5528.           BIG_DOWN                 "
  5529.           BIG_DOWN                  
  5530.           
  5531.           BIG_HOME            Selects the first question in the dialog box.
  5532.           BIG_HOME                                                         
  5533.           BIG_END             Selects the last question in the dialog box.
  5534.           BIG_END                                                         
  5535.           
  5536.           ASCEND              Executes db_freestorage.  Exits db_run with
  5537.           ASCEND                       db_freestorage         db_run     
  5538.                               the value ASCENDED if button_press is equal
  5539.                                         ASCENDED    button_press         
  5540.                               to 0, otherwise it exits with the value of
  5541.                               button_press.
  5542.                               button_press 
  5543.           
  5544.           DESCEND             If the current question is a multiple choice,
  5545.           DESCEND                                                          
  5546.                               "pulls down" the list of selection in a
  5547.                               vertical list, with the current response
  5548.                               highlighted.
  5549.           
  5550.                               If the current question is a free form or
  5551.                               reducer, enters the line editor.
  5552.           
  5553.                               If the current question is a list, the cursor
  5554.                               moves inside of the scrolling list and the
  5555.                               item which was highlighted when the user last
  5556.                               executed the list is highlighted.
  5557.           
  5558.                               If the current question is a button, does
  5559.                               nothing.
  5560.           
  5561.           EXPAND              If the current question is a multiple choice
  5562.           EXPAND                                                          
  5563.                               question it "pulls down" the available
  5564.                               responses to the question in a vertical list.
  5565.           
  5566.                               If the current question is a reducer is
  5567.                               "pulls down" ALL of the available responses
  5568.                               to the question in a vertical list.
  5569.           
  5570.           DELETE              does nothing.
  5571.           DELETE                           
  5572.           
  5573.           MOUSE_CONFIRM       Executes db_freestorage.  Exits db_run with
  5574.           MOUSE_CONFIRM                db_freestorage         db_run     
  5575.                               the value MOUSED and places MOUSE_EVENT at
  5576.                                         MOUSED            MOUSE_EVENT   
  5577.                               the tail of the queue.
  5578.            
  5579.           MOUSE_EVENT         Interprets the last mouse event (prev_x,
  5580.           MOUSE_EVENT                                          prev_x 
  5581.                               prev_y, and prev_click) into keystroke.  The
  5582.                               prev_y      prev_click                      
  5583.                               keystroke is then placed at the tail of the
  5584.                               queue.
  5585.           
  5586.           MOUSE_DESCEND       If the current question is a reducer or a
  5587.           MOUSE_DESCEND                                                
  5588.                               multiple choice question db_run calls the
  5589.                                                        db_run          
  5590.                               line editor and places the cursor at the
  5591.                               location clicked on in the text.
  5592.           
  5593.  
  5594.  
  5595.  
  5596.  
  5597.  
  5598.                                        - 61 -
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.           DialogPro v 2.1                                       Users Guide
  5605.                                                            Reference Manual
  5606.  
  5607.  
  5608.                               If the current question is a list,
  5609.                               MOUSE_EVENT is placed at the tail of the
  5610.                               MOUSE_EVENT                             
  5611.                               queue and the list is executed.
  5612.           
  5613.           STORE               Executes db_storeanswers.
  5614.           STORE                        db_storeanswers.
  5615.           
  5616.           RESTORE             Executes db_restoreanswers.
  5617.           RESTORE                      db_restoreanswers 
  5618.           
  5619.           FREE_STORAGE        Executes db_freestorage.
  5620.           FREE_STORAGE                 db_freestorage 
  5621.           
  5622.           POSITION            Selects the question based on the value of
  5623.           POSITION                                                      
  5624.                               the next integer in the event queue.
  5625.           
  5626.           POSITION_TOGGLE     Does nothing.
  5627.           POSITION_TOGGLE                  
  5628.           
  5629.           POSITION_CONFIRM    Does nothing.
  5630.           POSITION_CONFIRM                 
  5631.           
  5632.           EXECUTE             Executes a function by generating a function
  5633.           EXECUTE                                                         
  5634.                               pointer based on the next two instructions in
  5635.                               the event queue.  The function is passed
  5636.                               db_ptr as a parameter.  The function is
  5637.                               db_ptr                                 
  5638.                               continually execute until it returns an
  5639.                               integer value of TRUE.
  5640.                                                TRUE 
  5641.           
  5642.           alphanumeric        If on a free_form or reducer, erases the
  5643.                               current response, makes the character pressed
  5644.                               the first character in the new response and
  5645.                               enters the line editor.
  5646.           
  5647.                               If on a multiple choice, selects the next
  5648.                               item beginning with that character.
  5649.           
  5650.           NEXT, PREVIOUS      Selects the next/previous question.
  5651.           NEXT  PREVIOUS                                         
  5652.           
  5653.           If db_ptr->size_ok is TRUE then:
  5654.              ______                       
  5655.                    ->size_ok              
  5656.              ______                       
  5657.           
  5658.           SIZE_LT             Pulls right border of window (db_ptr->handle)
  5659.                                                             ______         
  5660.           SIZE_LT                                                 ->handle 
  5661.                                                             ______         
  5662.                               in one character.
  5663.           
  5664.           SIZE_RT             Pulls right border of window (db_ptr->handle)
  5665.                                                             ______         
  5666.           SIZE_RT                                                 ->handle 
  5667.                                                             ______         
  5668.                               out one character.
  5669.           
  5670.           SIZE_UP             Pulls bottom border of tile (db_ptr->handle,
  5671.                                                            ______         
  5672.           SIZE_UP                                                ->handle 
  5673.                                                            ______         
  5674.                               QUESTION->tile_handle) up one character.
  5675.                               QUESTION->tile_handle                   
  5676.           
  5677.           SIZE_DN             Pulls bottom border of tile down one
  5678.           SIZE_DN                                                 
  5679.                               character.
  5680.           
  5681.           BIG_SIZE_LT         Same as above but by 8 characters.
  5682.           BIG_SIZE_LT                                           
  5683.           
  5684.           BIG_SIZE_RT                        "
  5685.           BIG_SIZE_RT                         
  5686.           
  5687.           BIG_SIZE_UP                        "
  5688.           BIG_SIZE_UP                         
  5689.           
  5690.  
  5691.  
  5692.  
  5693.                                        - 62 -
  5694.  
  5695.  
  5696.  
  5697.  
  5698.  
  5699.           DialogPro v 2.1                                       Users Guide
  5700.                                                            Reference Manual
  5701.  
  5702.  
  5703.           BIG_SIZE_DN                        "
  5704.           BIG_SIZE_DN                         
  5705.           
  5706.           SCROLL_LT           Scrolls virtual screen (db_ptr->handle,
  5707.                                                       ______         
  5708.           SCROLL_LT                                         ->handle 
  5709.                                                       ______         
  5710.                               QUESTION->tile_handle) left one column.
  5711.                               QUESTION->tile_handle                  
  5712.           
  5713.           SCROLL_RT                          "         right     ".
  5714.           SCROLL_RT                                                
  5715.           
  5716.           SCROLL_UP                          "         up one row.
  5717.           SCROLL_UP                                               
  5718.           
  5719.           SCROLL_DN                          "         down      ".
  5720.           SCROLL_DN                                                
  5721.           
  5722.           BIG_SCROLL_LT       Same as above but by 8.
  5723.           BIG_SCROLL_LT                              
  5724.           
  5725.           BIG_SCROLL_RT                      "
  5726.           BIG_SCROLL_RT                       
  5727.           
  5728.           BIG_SCROLL_UP                      "
  5729.           BIG_SCROLL_UP                       
  5730.           
  5731.           BIG_SCROLL_DN                      "
  5732.           BIG_SCROLL_DN                       
  5733.           
  5734.           MOVE_LT             Moves the window (db_ptr->handle) left one
  5735.                                                 ______                  
  5736.           MOVE_LT                                     ->handle          
  5737.                                                 ______                  
  5738.                               character.
  5739.           
  5740.           MOVE_RT                            "              right.
  5741.           MOVE_RT                                                 
  5742.           
  5743.           MOVE_UP                            "              up.
  5744.           MOVE_UP                                              
  5745.           
  5746.           MOVE_DN                            "              down.
  5747.           MOVE_DN                                                
  5748.           
  5749.           BIG_MOVE_LT         Same as above but by 8.
  5750.           BIG_MOVE_LT                                
  5751.           
  5752.           BIG_MOVE_RT                        "
  5753.           BIG_MOVE_RT                         
  5754.           
  5755.           BIG_MOVE_UP                        "
  5756.           BIG_MOVE_UP                         
  5757.           
  5758.           BIG_MOVE_DN                        "
  5759.           BIG_MOVE_DN                         
  5760.           
  5761.           
  5762.           
  5763.           2. Line Editor
  5764.           
  5765.           The line editor is invoked when editing a free_form or a reducer.
  5766.           Each message is translated as follows at the line editor level
  5767.                                                 ________________________
  5768.           (several of the messages transfer porcessing to the dialog box
  5769.           level--to see how messages are interpreted at the dialog box
  5770.           level review the previous section):
  5771.           
  5772.           CONFIRM             Exits the line editor and makes
  5773.           CONFIRM                                            
  5774.                               CURRFF->response (or CURRR->response, for a
  5775.                               ______               _____                 
  5776.                                     ->response          ->response       
  5777.                               ______               _____                 
  5778.                               reducer) equal to the current edited
  5779.                               response.  Also, places a CONFIRM at the tail
  5780.                                                         CONFIRM            
  5781.                               of the queue.  If the question is a reducer
  5782.                               and the current response matches more than
  5783.                               one of the specified items, the possible
  5784.                               matches are displayed in a "pulldown" list.
  5785.  
  5786.  
  5787.  
  5788.                                        - 63 -
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.           DialogPro v 2.1                                       Users Guide
  5795.                                                            Reference Manual
  5796.  
  5797.  
  5798.           
  5799.                               Executes CURRFF->action(db_ptr) (or
  5800.                                        ______                    
  5801.                                              ->action(db_ptr)    
  5802.                                        ______                    
  5803.                               CURRR->action(db_ptr).)
  5804.                               _____                  
  5805.                                    ->action(db_ptr)  
  5806.                               _____                  
  5807.           
  5808.           ABORT               Exits the line editor.  The current edited
  5809.           ABORT                                                         
  5810.                               response is replaced by the previous response
  5811.                               (CURRFF->response or CURRR->response.) Also
  5812.                                ______              _____                 
  5813.                                      ->response         ->response       
  5814.                                ______              _____                 
  5815.                               places an ABORT at the tail of the queue.
  5816.                                         ABORT                          
  5817.           
  5818.                               Executes CURRFF->action(db_ptr) (or
  5819.                                        ______                    
  5820.                                              ->action(db_ptr)    
  5821.                                        ______                    
  5822.                               CURRR->action(db_ptr).)
  5823.                               _____                  
  5824.                                    ->action(db_ptr)  
  5825.                               _____                  
  5826.           
  5827.           LEFT                Selects the character to the left.
  5828.           LEFT                                                  
  5829.           
  5830.           RIGHT                              "             right.
  5831.           RIGHT                                                  
  5832.           
  5833.           HOME                Selects the first character.
  5834.           HOME                                            
  5835.           
  5836.           END                 Selects the last character.
  5837.           END                                            
  5838.           
  5839.           BIG_LEFT            Selects the first character in the word to
  5840.           BIG_LEFT                                                      
  5841.                               the left.
  5842.           
  5843.           BIG_RIGHT           Selects the first character in the word to
  5844.           BIG_RIGHT                                                     
  5845.                               the right.
  5846.           
  5847.           ASCEND              Same as CONFIRM.
  5848.           ASCEND                      CONFIRM 
  5849.           
  5850.           DESCEND                  "
  5851.           DESCEND                   
  5852.           
  5853.           BACKSPACE           Deletes the character to the left of the
  5854.           BACKSPACE                                                   
  5855.                               cursor.
  5856.           
  5857.           DELETE              Deletes the character under the cursor.
  5858.           DELETE                                                     
  5859.           
  5860.           MOUSE_CONFIRM       Same as CONFIRM, but also puts a MOUSE_EVENT
  5861.           MOUSE_CONFIRM               CONFIRM                  MOUSE_EVENT
  5862.                               at the tail of the queue.
  5863.           
  5864.           MOUSE_EVENT         Converts the last mouse event into a message
  5865.           MOUSE_EVENT                                                     
  5866.                               of either POSITION or MOUSE_CONFIRM.
  5867.                                         POSITION    MOUSE_CONFIRM 
  5868.           
  5869.           STORE               if CURRFF->insurance is NULL makes it equal
  5870.                                  ______                                  
  5871.           STORE                        ->insurance    NULL               
  5872.                                  ______                                  
  5873.                               to CURRFF->response.
  5874.                                  ______           
  5875.                                        ->response 
  5876.                                  ______           
  5877.           
  5878.           RESTORE             If CURRFF->insurance does not equal NULL
  5879.                                  ______                               
  5880.           RESTORE                      ->insurance                NULL
  5881.                                  ______                               
  5882.                               makes CURRFF->response equal to
  5883.                                     ______                   
  5884.                                           ->response         
  5885.                                     ______                   
  5886.                               CURRFF->insurance and sets CURRFF->insurance
  5887.                               ______                     ______           
  5888.                                     ->insurance                ->insurance
  5889.                               ______                     ______           
  5890.                               to NULL.
  5891.                                  NULL 
  5892.           
  5893.           FREE_STORAGE        Set CURRFF->insurance to NULL.
  5894.                                   ______                    
  5895.           FREE_STORAGE                  ->insurance    NULL 
  5896.                                   ______                    
  5897.           
  5898.           POSITION            Selects the character based on the value of
  5899.           POSITION                                                       
  5900.                               the next integer in the event queue.
  5901.           
  5902.  
  5903.  
  5904.  
  5905.                                        - 64 -
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.           DialogPro v 2.1                                       Users Guide
  5912.                                                            Reference Manual
  5913.  
  5914.  
  5915.           3. list question
  5916.           
  5917.           Each message is translated as follows at the list level (several
  5918.                                                 _________________         
  5919.           of the messages transfer porcessing to the dialog box level--to
  5920.           see how messages are interpreted at the dialog box level review
  5921.           the previous section):
  5922.           
  5923.           CONFIRM             Executes CURRLIST->action(db_ptr), places a
  5924.                                        _________                         
  5925.           CONFIRM                               >action(db_ptr)          
  5926.                                        _________                         
  5927.                               CONFIRM at the tail of the queue, and exits
  5928.                               CONFIRM                                    
  5929.                               back to db_run.
  5930.           
  5931.           PRESS_BUTTON        check the current item on/off.
  5932.           PRESS_BUTTON                                      
  5933.           
  5934.           ABORT               Executes lst_freestorage, executes
  5935.           ABORT                                                 
  5936.                               CURRLIST->action(db_ptr), places an ABORT at
  5937.                               _________                                   
  5938.                                        >action(db_ptr)                    
  5939.                               _________                                   
  5940.                               the tail of the queue, and exits back to
  5941.                               db_run.
  5942.           
  5943.           UP                  Highlights item above current item.
  5944.           UP                                                     
  5945.           
  5946.           DOWN                Highlights item below current item.
  5947.           DOWN                                                   
  5948.           
  5949.           LEFT                If in a multicolumn list selects the item to
  5950.           LEFT                                                            
  5951.                               the left of the current item.
  5952.           
  5953.           RIGHT               If in a multicolumn list selects the item to
  5954.           RIGHT                                                           
  5955.                               the right of the current item.
  5956.           
  5957.           HOME                Highlights the first item.
  5958.           HOME                                          
  5959.           
  5960.           END                 Highlights the last item.
  5961.           END                                          
  5962.           
  5963.           BIG_UP              Highlights the item a window's length above.
  5964.           BIG_UP                                                          
  5965.           
  5966.           BIG_DOWN            Highlights the item a window's length below.
  5967.           BIG_DOWN                                                        
  5968.           
  5969.           ASCEND              Exits the list, confirms the current
  5970.           ASCEND                                                  
  5971.                               responses, and executes
  5972.                               CURRLIST->action(CURRLIST->list_ptr). 
  5973.                               _________        _________            
  5974.                                        >action(         >list_ptr)  
  5975.                               _________        _________            
  5976.           
  5977.           DESCEND                  "
  5978.           DESCEND                   
  5979.           
  5980.           MOUSE_CONFIRM       Same as ASCEND, but also puts a MOUSE_EVENT
  5981.           MOUSE_CONFIRM               ASCEND                  MOUSE_EVENT
  5982.                               at the tail of the queue.
  5983.           
  5984.           MOUSE_EVENT         Converts the last mouse event into a message
  5985.           MOUSE_EVENT                                                     
  5986.                               of either POSITION, POSITION_TOGGLE or
  5987.                                         POSITION  POSITION_TOGGLE   
  5988.                               MOUSE_CONFIRM.
  5989.                               MOUSE_CONFIRM 
  5990.           
  5991.           STORE               Stores the current selected item in another
  5992.           STORE                                                          
  5993.                               data structure.
  5994.           
  5995.           RESTORE             Restores the list to its state when STORE was
  5996.           RESTORE                                                 STORE    
  5997.                               called.
  5998.  
  5999.  
  6000.  
  6001.                                        - 65 -
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.           DialogPro v 2.1                                       Users Guide
  6008.                                                            Reference Manual
  6009.  
  6010.  
  6011.           
  6012.           FREE_STORAGE        Free data structures created on STORE.
  6013.           FREE_STORAGE                                        STORE 
  6014.           
  6015.           POSITION            Highlights an item based on the value of the
  6016.           POSITION                                                        
  6017.                               next instruction in the event queue.
  6018.           
  6019.           POSITION_TOGGLE     Highlights item clicked on (based on the
  6020.           POSITION_TOGGLE                                             
  6021.                               value of the next instruction in the event
  6022.                               queue,) and toggles the item on/off.
  6023.           
  6024.           POSITION_CONFIRM         "
  6025.           POSITION_CONFIRM          
  6026.           
  6027.           
  6028.           
  6029.           
  6030.           4. Pull down list
  6031.           
  6032.           Pull down lists can originate from a multiple choice or a reducer
  6033.           question.  Regardless of how they came about they operate the
  6034.           same.  Each message is translated as follows at the pull down
  6035.                                                        ________________
  6036.           list level (several of the messages transfer porcessing to the
  6037.           __________                                                    
  6038.           dialog box level--to see how messages are interpreted at the
  6039.           dialog box level review the previous section):
  6040.           
  6041.           CONFIRM             Selects the current item as the answer, exits
  6042.           CONFIRM                                                          
  6043.                               the pull down list and places a RIGHT at the
  6044.                                                               RIGHT       
  6045.                               tail of the queue.
  6046.           
  6047.                               Executes CURRMC->action(db_ptr) (or
  6048.                                        ______                    
  6049.                                              ->action(db_ptr)    
  6050.                                        ______                    
  6051.                               CURRR->action(db_ptr).)
  6052.                               _____                  
  6053.                                    ->action(db_ptr)  
  6054.                               _____                  
  6055.           
  6056.           ABORT               Does not change the selected item, and exits
  6057.           ABORT                                                           
  6058.                               the pull down list.
  6059.           
  6060.                               Executes CURRMC->action(db_ptr) (or
  6061.                                        ______                    
  6062.                                              ->action(db_ptr)    
  6063.                                        ______                    
  6064.                               CURRR->action(db_ptr).)
  6065.                               _____                  
  6066.                                    ->action(db_ptr)  
  6067.                               _____                  
  6068.           
  6069.           UP                  Highlights item above current item.
  6070.           UP                                                     
  6071.           
  6072.           DOWN                Highlights item below current item.
  6073.           DOWN                                                   
  6074.           
  6075.           LEFT                If a multicolumn list selects the item to the
  6076.           LEFT                                                             
  6077.                               left of the current item.
  6078.           
  6079.           RIGHT               If a multicolumn list selects the item to the
  6080.           RIGHT                                                            
  6081.                               right of the current item.
  6082.           
  6083.           HOME                Highlights the first item.
  6084.           HOME                                          
  6085.           
  6086.           END                 Highlights the last item.
  6087.           END                                          
  6088.           
  6089.           BIG_UP              Highlights the item a window's length above.
  6090.           BIG_UP                                                          
  6091.           
  6092.           BIG_DOWN            Highlights the item a window's length below.
  6093.           BIG_DOWN                                                        
  6094.  
  6095.  
  6096.  
  6097.                                        - 66 -
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103.           DialogPro v 2.1                                       Users Guide
  6104.                                                            Reference Manual
  6105.  
  6106.  
  6107.           
  6108.           ASCEND              Selects the current item as the answer, and
  6109.           ASCEND                                                         
  6110.                               exits the pull down list.
  6111.           
  6112.                               Executes CURRMC->action(db_ptr) (or
  6113.                                        ______                    
  6114.                                              ->action(db_ptr)    
  6115.                                        ______                    
  6116.                               CURRR->action(db_ptr).)
  6117.                               _____                  
  6118.                                    ->action(db_ptr)  
  6119.                               _____                  
  6120.           
  6121.           DESCEND                  "
  6122.           DESCEND                   
  6123.           
  6124.           MOUSE_CONFIRM       Same as ASCEND, but also puts a MOUSE_EVENT
  6125.           MOUSE_CONFIRM               ASCEND                  MOUSE_EVENT
  6126.                               at the tail of the queue.
  6127.           
  6128.           MOUSE_EVENT         Converts the last mouse event into a message
  6129.           MOUSE_EVENT                                                     
  6130.                               of either POSITION, POSITION_TOGGLE or
  6131.                                         POSITION  POSITION_TOGGLE   
  6132.                               MOUSE_CONFIRM.
  6133.                               MOUSE_CONFIRM 
  6134.           
  6135.           STORE               Stores the current selected item in another
  6136.           STORE                                                          
  6137.                               data structure.
  6138.           
  6139.           RESTORE             Restores the list to its state when STORE was
  6140.           RESTORE                                                 STORE    
  6141.                               called.
  6142.           
  6143.           FREE_STORAGE        Free data structures created on STORE.
  6144.           FREE_STORAGE                                        STORE 
  6145.           
  6146.           POSITION            Highlights an item based on the position of
  6147.           POSITION                                                       
  6148.                               the last mouse event.
  6149.           
  6150.           POSITION_TOGGLE     Highlights item clicked on, selects the item,
  6151.           POSITION_TOGGLE                                                  
  6152.                               and exits.
  6153.           
  6154.           POSITION_CONFIRM         "
  6155.           POSITION_CONFIRM          
  6156.           
  6157.           
  6158.           XI.   Resource Files Reference
  6159.           
  6160.           A. Introduction
  6161.           
  6162.           Resource files allow you to define a dialog box outside of the
  6163.           program and then pass the info to DialogPro functions to create,
  6164.           display or run, and destroy dialog boxes.
  6165.           
  6166.           
  6167.           B. Creating Resource Files
  6168.           
  6169.           1. Introduction
  6170.           
  6171.           A resource file is a collection of dialog box definitions.  A
  6172.           dialog box definition is a list of various records of different
  6173.           types.  Each record begins in the first column and is terminated
  6174.           by a newline.
  6175.           
  6176.           
  6177.           For example a typical resource file definition would be:
  6178.           
  6179.  
  6180.  
  6181.  
  6182.                                        - 67 -
  6183.  
  6184.  
  6185.  
  6186.  
  6187.  
  6188.           DialogPro v 2.1                                       Users Guide
  6189.                                                            Reference Manual
  6190.  
  6191.  
  6192.           ^1
  6193.           "",23,71,1,0,0,7
  6194.           "Program List: <None>",2,2,0,7
  6195.           "Current File: untitled.c",2,3,0,7
  6196.           "Warning Levels",2,5,0,7
  6197.           "Output Options",19,5,0,7
  6198.           "Miscellaneous",44,5,0,7
  6199.           R," Level ~0",5,6,0,1
  6200.           R," Level ~1",5,7,0,0
  6201.           R," Level ~2",5,8,0,0
  6202.           R," Level ~3",5,9,0,0
  6203.           R," ~Obj",22,6,1,1
  6204.           R," ~Memory",22,7,1,0
  6205.           R," E~xe",22,8,1,0
  6206.           R," S~yntax Check Only",22,9,1,0
  6207.           C," ~Debug",47,6,0
  6208.           C," ~Pointer Check",47,7,0
  6209.           C," ~Stack Check",47,8,0
  6210.           C," ~Language Extensions",47,9,0
  6211.           C," Optimi~zations",47,10,0
  6212.           F,"~Include:",2,13,12,13,58,""
  6213.           F,"De~fine:",2,16,12,16,58,""
  6214.           B," ~Build Program ",4,20,7181,7181,20,2
  6215.           B," ~Compile File ",23,20,7181,32001,21,1
  6216.           B," ~Rebuild All ",41,20,7181,32002,22,1
  6217.           B," Cancel ",58,20,283,283,1,1
  6218.           #
  6219.           
  6220.           
  6221.           2. ID record
  6222.           
  6223.           Every dialog box in a resource file has an id number.  You start
  6224.           a dialog box definition with a ^ in the first column followed
  6225.           immediately by the dialog box id, like this:
  6226.           
  6227.           ^1000
  6228.           
  6229.           
  6230.           
  6231.           3. Window record
  6232.           
  6233.           The next line is the dialog box window record.  It defines the
  6234.           window to display the dialog box in.  This record is defined as
  6235.           the first line beginning with a " after the ID record.
  6236.           
  6237.           
  6238.           A valid window record would be:
  6239.           
  6240.           "Sample Dialog Box",23,71,1,0,0,7
  6241.           
  6242.           Each field (separated by a comma) is:
  6243.           
  6244.           1.   The window name
  6245.           2.   Rows in the window
  6246.  
  6247.  
  6248.  
  6249.                                        - 68 -
  6250.  
  6251.  
  6252.  
  6253.  
  6254.  
  6255.           DialogPro v 2.1                                       Users Guide
  6256.                                                            Reference Manual
  6257.  
  6258.  
  6259.           3.   Columns in the window
  6260.           4.   0,1,or 2 for no border, a single border, or a double border.
  6261.           5.   0 or 1 for "bring to the top of window stack when activated
  6262.                with db_run()" or "don't ... ", respectively.
  6263.           6.   foreground color of window's virtual screen.
  6264.           7.   background color of window's virtual screen.
  6265.           
  6266.           
  6267.           4. Text Literal records
  6268.           
  6269.           Text Literal records begin with a ".  They represent literal text
  6270.           to be output to the dialog box window's virtual screen when it is
  6271.           initially created.
  6272.           
  6273.           A valid text literal record would be:
  6274.           
  6275.           "Program List: <None>",2,2,0,7
  6276.           
  6277.           With each field interpreted as follows:
  6278.           
  6279.           1.   The text to output.  This text is output using the
  6280.                vs_putcodstr() conventions allowing you to change the
  6281.                display attributes with embedded commands. 
  6282.           
  6283.           2.   X xoordinate
  6284.           3.   Y coordinate
  6285.           4.   foreground color
  6286.           5.   background color
  6287.           
  6288.           
  6289.           5. Question records
  6290.           
  6291.           a. Introduction
  6292.           
  6293.           There are several types of question records.  The order that they
  6294.           are listed determines the order that the user navigates the
  6295.           questions. 
  6296.           
  6297.           
  6298.           b. Radio Button records
  6299.           
  6300.           These records define DialogPro radio buttons.  A valid radio
  6301.           button record would be:
  6302.           
  6303.           R," Level ~0",5,6,0,1
  6304.           
  6305.           The meaning of each field is:
  6306.           
  6307.           1.   Must be a capital R.  Defines the record as a radio button
  6308.                record.
  6309.           2.   The radio button statement string.  Note that the radio
  6310.                button check characters, are placed immediately to the left
  6311.                of the statement.  If you want a space between them you
  6312.                should pad this string with spaces on the left.  Also if you
  6313.  
  6314.  
  6315.  
  6316.                                        - 69 -
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.           DialogPro v 2.1                                       Users Guide
  6323.                                                            Reference Manual
  6324.  
  6325.  
  6326.                want an alt-hot key assigned to the radio button put a ~ to
  6327.                the left of the character (must be in the range
  6328.                [a..z,0..9]).
  6329.           3.   X coordinate
  6330.           4.   Y coordinate
  6331.           5.   Radio button group.  When a radio button is checked it
  6332.                "unchecks" all other radio buttons in its button group.
  6333.           6.   0 or 1, for "checked" or "unchecked" at startup.
  6334.           
  6335.           When the dialog box is created radio button records will be setup
  6336.           as DialogPro rcbutton structs.
  6337.           
  6338.           
  6339.           c. Checkbox records
  6340.           
  6341.           Checkboxes are very similar to radio buttons except that they are
  6342.           not "tied" to other buttons.  So checking a checkbox has no
  6343.           effect on other checkboxes.
  6344.           
  6345.           A valid checkbox record would be:
  6346.           
  6347.           C," ~Debug",47,6,0
  6348.           
  6349.           The meaning of each field is:
  6350.           
  6351.           1.   Must be a capital C.  Defines the record as a checkbox
  6352.                record.
  6353.           
  6354.           2.   The checkbox statement string.  Note that the checkbox check
  6355.                characters, are placed immediately to the left of the
  6356.                statement.  If you want a space between them you should pad
  6357.                this string with spaces on the left.  Also if you want an
  6358.                alt-hot key assigned put a ~ to the left of the character
  6359.                (must be in the range [a..z,0..9]).
  6360.           3.   X coordinate
  6361.           4.   Y coordinate
  6362.           5.   0 or 1, for "checked" or "unchecked" at startup.
  6363.           
  6364.           When the dialog box is created checkbox records will be setup as
  6365.           as DialogPro rcbutton structs.
  6366.           
  6367.           
  6368.           d. Free Form records
  6369.           
  6370.           Free form records allow you to gather one line text responses.  A
  6371.           valid free form record would be:
  6372.           
  6373.           F,"~Include:",2,13,12,13,58,""
  6374.           
  6375.           The meaning of each field is:
  6376.           
  6377.           1.   Must be a capital F.  Defines the record as a free form
  6378.                record.
  6379.  
  6380.  
  6381.  
  6382.  
  6383.                                        - 70 -
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.           DialogPro v 2.1                                       Users Guide
  6390.                                                            Reference Manual
  6391.  
  6392.  
  6393.           2.   The free form statement string.  If you want an alt- hot key
  6394.                assigned put a ~ to the left of the character (must be in
  6395.                the range [a..z,0..9]).
  6396.           3.   statement X coordinate
  6397.           4.   statement Y coordinate
  6398.           5.   response X coordinate
  6399.           6.   response Y coordinate
  6400.           7.   response area length
  6401.           8.   Initial response string
  6402.           
  6403.           
  6404.           When the dialog box is created free form records will be setup as
  6405.           as DialogPro free_form structs.
  6406.           
  6407.           
  6408.           e. Button records
  6409.           
  6410.           Button records allow you to put info into the queue for further
  6411.           processing (generally some type of exit with a specified value),
  6412.           or execute a function.  (However, buttons defined through
  6413.           resource files can't execute a function.)   valid button record
  6414.           would be:
  6415.           
  6416.           B," ~Build Program ",4,20,7181,7181,20,2
  6417.           
  6418.           The meaning of each field is:
  6419.           
  6420.           1.   Must be a capital B.  Defines the record as a button record.
  6421.           2.   The button statement string.  If you want an alt- hot key
  6422.                assigned put a ~ to the left of the character (must be in
  6423.                the range [a..z,0..9]).
  6424.           3.   X coordinate
  6425.           4.   Y coordinate
  6426.           5.   Keyfake value.  When the button is "pressed" it will put
  6427.                this value into the queue.  This is generally the value for
  6428.                the ENTER key (7181) or the ESC key (283.)  These values
  6429.                will a. force db_run() to exit via CONFIRM or b. force
  6430.                db_run() to exit via ABORT (i.e. restoring all fields to
  6431.                their original state before exiting.)
  6432.           6.   Keyflicker value.  When this value is processed by db_run()
  6433.                it will "flash" this button, put the value of Keyfake into
  6434.                the queue, but NOT make this the selected question.
  6435.           7.   If "pressing" this button results in db_run() exiting it
  6436.                will exit with this value if non-zero otherwise it will exit
  6437.                with a standard value -- i.e. CONFIRMED, ABORTED, ASCENDED,
  6438.                or DESCENDED.
  6439.           8.   0, 1, or 2.  The button will have, respectively, NO border,
  6440.                a single border, or a double border.
  6441.           
  6442.           When this record is interpreted by create_db() it will generate a
  6443.           DialogPro button struct.
  6444.           
  6445.           
  6446.  
  6447.  
  6448.  
  6449.  
  6450.                                        - 71 -
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.           DialogPro v 2.1                                       Users Guide
  6457.                                                            Reference Manual
  6458.  
  6459.  
  6460.           f. List records
  6461.           
  6462.           List records create scrolling lists.  A valid list record would
  6463.           be:
  6464.           
  6465.           L,"~List",40,1,40,3,5,15,0,1,1,"Ken","Mary","Robert","Mercedes"
  6466.           
  6467.           The meaning of each field is:
  6468.           
  6469.           1.   Must be a capital L.  Defines the record as a list record.
  6470.           2.   The list statement string.  If you want an alt- hot key
  6471.                assigned put a ~ to the left of the character (must be in
  6472.                the range [a..z,0..9]).
  6473.           3.   statement X coordinate
  6474.           4.   statement Y coordinate
  6475.           5.   list box X coordinate
  6476.           6.   list box y coordinate
  6477.           7.   list box viewport rows
  6478.           8.   list box viewport columns
  6479.           9.   list type -- 0 is check any, 1 is check just one.
  6480.           10.  maximum number of response columns.  For example, a 1 would
  6481.                make a single long list of the selectable items, a 2 would
  6482.                make a 2 column list, etc.  A very large number will give
  6483.                the effect of a list that scrolls to the right rather than
  6484.                down, where each column is no longer than the height the
  6485.                list viewport. (like the MS file selector lists in Quick C,
  6486.                for example.)
  6487.           10.  border, where 0 is none, 1 is single, and 2 is double
  6488.                bordered.
  6489.           
  6490.           
  6491.           g. Multiple Choice records
  6492.           
  6493.           Let's you define multiple choice fields in your dialog box.  A
  6494.           valid multiple choice record would be:
  6495.           
  6496.           M,"~State",1,5,10,5,20,"Texas","New York","Maine","Massachusetts"
  6497.           
  6498.           
  6499.           Each field has the following meaning:
  6500.           
  6501.           1.   Must be a capital M, denoting a multiple choice record.
  6502.           2.   Indicates the statement portion of the field.  If you want
  6503.                an alt-hot key assigned to this question precede the hot kye
  6504.                character with a ~.
  6505.           3.   statement X coordinate
  6506.           4.   statement Y coordinate
  6507.           5.   response X coordinate
  6508.           6.   response Y coordinate
  6509.           7.   response area length
  6510.           8 .. Nth
  6511.                a comma delimited list of the allowable responses to the
  6512.                multiple choice question.
  6513.           
  6514.  
  6515.  
  6516.  
  6517.                                        - 72 -
  6518.  
  6519.  
  6520.  
  6521.  
  6522.  
  6523.           DialogPro v 2.1                                       Users Guide
  6524.                                                            Reference Manual
  6525.  
  6526.  
  6527.           When this record is interpreted it will be setup as a DialogPro
  6528.           multi_choice struct.
  6529.           
  6530.           
  6531.           h. Pulldown record
  6532.           
  6533.           This record lets you specify a pull down menu.  This is generally
  6534.           used to specify one of several pull down menus in a menu bar. 
  6535.           Although you can include pull downs as part of any dialog box. 
  6536.           When you make a selection from a pull down it exits the dialog
  6537.           box with a value of MENUED.  A valid pull down record would be:
  6538.           
  6539.           P,"~Pulldown",40,15,8,"One",1,"Two",1,"-----------",2,"Three",1,"Four",1
  6540.           
  6541.           
  6542.           Each field is interpreted as follows:
  6543.           
  6544.           1.   Must be a capital P, denoting a pull down record.
  6545.           2.   The statement portion of the pull down.
  6546.           3.   statement X coordinate
  6547.           4.   statement Y coordinate
  6548.           5.   The length of the active area (determines what will
  6549.                highlight when you select the pulldown and what area will be
  6550.                sensitive to the mouse.)
  6551.           6 to Nth
  6552.                A comma delimited list of field pairs, where the first
  6553.                element of the pair is a list element to display in the pull
  6554.                down menu, and the second field indicates 1, a valid
  6555.                selection, 2 a title bar, 0 can't be selected.
  6556.           
  6557.           When this record is interpreted it will be setup as a DialogPro
  6558.           multi_choice struct.
  6559.           
  6560.           
  6561.           6. Terminator record
  6562.           
  6563.           The end of a dialog box definition is signified by the terminator
  6564.           record.  A terminator record is any line beginning with a #
  6565.           character.
  6566.           
  6567.           
  6568.           C. Testing Resource Files
  6569.           
  6570.           Having create a resource file, you must index it using
  6571.           idxtext.exe.  idxtext will prompt you for the name of the file to
  6572.           index and a file name to write the index to.  The resource file
  6573.           test program, dbtest.exe, uses the convention of giving both
  6574.           files the same name, with the resource file using an RSC
  6575.           extension and the index file an IDX extension.  Since dbtest is
  6576.           fairly useful we recommend that you use the same naming
  6577.           conventions.
  6578.           
  6579.           After having indexed your resource file.  You can test it by
  6580.           using dbtest.exe as follows.
  6581.  
  6582.  
  6583.  
  6584.                                        - 73 -
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.           DialogPro v 2.1                                       Users Guide
  6591.                                                            Reference Manual
  6592.  
  6593.  
  6594.           
  6595.           dbtest <filename -- no extension> <ids to test, e.g. 32 12 1>
  6596.           
  6597.           
  6598.           For example, if you have create a resource file by the name of
  6599.           TEST.RSC and an index file with the name TEST.IDX, and you want
  6600.           to view dialog boxes 12 and 5.  You would type the following:
  6601.           
  6602.           dbtest test 12 5
  6603.           
  6604.           We should point out that dbtest provides very little error
  6605.           checking it is quit easy to create resource files which will
  6606.           "bomb" dbtest.
  6607.           
  6608.           
  6609.           D. Incorporating Resource Files into your programs
  6610.           
  6611.           To incorporate resource files into your programs you simply call
  6612.           the create_db() function.  A typical create_db() function call
  6613.           would look like this:
  6614.           
  6615.           {
  6616.                dialog_box *db_ptr;
  6617.           
  6618.                /* create a dialog box from id 12 in the test.rsc file */
  6619.                /* use the test.idx file to find the offset of id 12 */
  6620.                /* in test.rsc */
  6621.                db_ptr = create_db("test.rsc",0,"test.idx",0,12);
  6622.           
  6623.                /* run the dialog box */
  6624.                db_run(db_ptr, 0);
  6625.           }
  6626.           
  6627.           To get the responses to a dialog box you need to query the
  6628.           structure member of the various questions comprising the dialog
  6629.           box.  In order to do this you you must know what DialogPro
  6630.           structures are created based on the resource file records.  This
  6631.           information is contained in the previous section on Question
  6632.           Records.  For example, this dialog box definition is comprised of
  6633.           :
  6634.           
  6635.           ^1
  6636.           "",23,71,1,0,0,7
  6637.           "Program List: <None>",2,2,0,7
  6638.           "Current File: untitled.c",2,3,0,7
  6639.           "Warning Levels",2,5,0,7
  6640.           "Output Options",19,5,0,7
  6641.           "Miscellaneous",44,5,0,7
  6642.           
  6643.             -- question 0 --
  6644.           R," Level ~0",5,6,0,1
  6645.           
  6646.             -- question 1 --
  6647.           R," Level ~1",5,7,0,0
  6648.  
  6649.  
  6650.  
  6651.                                        - 74 -
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.           DialogPro v 2.1                                       Users Guide
  6658.                                                            Reference Manual
  6659.  
  6660.  
  6661.           
  6662.             -- question 2 --
  6663.           R," Level ~2",5,8,0,0
  6664.           
  6665.             -- question 3 --
  6666.           R," Level ~3",5,9,0,0
  6667.           
  6668.           R," ~Obj",22,6,1,1
  6669.           R," ~Memory",22,7,1,0
  6670.           R," E~xe",22,8,1,0
  6671.           R," S~yntax Check Only",22,9,1,0
  6672.           C," ~Debug",47,6,0
  6673.           C," ~Pointer Check",47,7,0
  6674.           C," ~Stack Check",47,8,0
  6675.           C," ~Language Extensions",47,9,0
  6676.           C," Optimi~zations",47,10,0
  6677.           
  6678.             -- question 13 --
  6679.           F,"~Include:",2,13,12,13,58,""
  6680.           
  6681.           F,"De~fine:",2,16,12,16,58,""
  6682.           B," ~Build Program ",4,20,7181,7181,20,2
  6683.           B," ~Compile File ",23,20,7181,32001,21,1
  6684.           B," ~Rebuild All ",41,20,7181,32002,22,1
  6685.           B," Cancel ",58,20,283,283,1,1
  6686.           #
  6687.           
  6688.           If having created this dialog box, and run the dialog box, you
  6689.           could query the dialog box structures to determine the users
  6690.           responses.  For example, since question 0 is a radio button, we
  6691.           know that this is setup as an rcbutton struct, and we know that
  6692.           the rcbutton struct member, checked, indicates if the radio
  6693.           button was checked when we exited.  Therefore, we can get the
  6694.           user's response to this radio button as:
  6695.           
  6696.           ((rcbutton *)(db_ptr->questions[0]))->checked
  6697.           
  6698.           Alternatively you could use the #defines in dbpro.h to simplify
  6699.           this to:
  6700.           
  6701.           RCBUTTONQUEST(0)->checked
  6702.           
  6703.           likewise to get the users response to the free form question 13
  6704.           you would use:
  6705.           
  6706.           ((free_form *)(db_ptr->questions[13]))->response
  6707.           
  6708.           or
  6709.           
  6710.           FFQUEST(13)->response
  6711.           
  6712.           Once you have gotten the info you need from the dialog box you
  6713.           can release it from memory with a call to destory_db() like this:
  6714.           
  6715.  
  6716.  
  6717.  
  6718.                                        - 75 -
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.           DialogPro v 2.1                                       Users Guide
  6725.                                                            Reference Manual
  6726.  
  6727.  
  6728.           destroy_db(db_ptr)
  6729.           
  6730.           One important caveat to remember when using destroy_db() is that
  6731.           the assumption is made that the response to the free form
  6732.           questions have been captured by assigning them to some other
  6733.           variable before the destroy_db(), and therefore the memory
  6734.           allocated to the free form response is not released.  If you want
  6735.           to release all of the memory associated with a dialog box you
  6736.           must free() all the free_form.response members.
  6737.           
  6738.           
  6739.           E. Embedding Resource Files
  6740.           
  6741.           In the previous section we demonstrated how to use db_create() to
  6742.           access a resource file and display a dialog box.  In that section
  6743.           we said to ignore the 0's after the resource file and index file
  6744.           names in the call to create_db().  These values represent the
  6745.           offset into a file where the index info and or the resource info
  6746.           is found.  These parameters allow you to combine the resource and
  6747.           index files with other files, your exe file for example.
  6748.           
  6749.           To illustrate.  Suppose you create an exe file called
  6750.           dbbound.exe, a resource file called test.rsc, and a resource
  6751.           index file called test.idx.  Let's say that their respective file
  6752.           sizes are:
  6753.           
  6754.           dbbound.exe         131,012
  6755.           test.idx                100
  6756.           test.rsc              3,456
  6757.           
  6758.           if you were to copy these files into a single file using the DOS
  6759.           copy command like this:
  6760.           
  6761.           copy /b dbbound.exe+test.idx+test.rsc dbbound1.exe
  6762.           
  6763.           the index information would be found at an offset of 131,012 in
  6764.           dbbound1.exe, and the resource file information would be located
  6765.           at an offset of 131,112 in dbbound1.exe.
  6766.           
  6767.           With this information in hand you could edit the original
  6768.           dbbound.exe source as follows:
  6769.           
  6770.           main(argv,argc)
  6771.           int argv;
  6772.           char argc[];
  6773.           {
  6774.                dialog_box *db_ptr;
  6775.           
  6776.                init_dbpro();
  6777.           
  6778.                /* create a dialog box from resource file info found at */
  6779.                /* an offset of 131112 of the exe file (argc[0]), and the */
  6780.                /* index file info found at an offset of 131,012 in the */
  6781.                /* exe file -- use dialog box id #1 to create db */
  6782.  
  6783.  
  6784.  
  6785.                                        - 76 -
  6786.  
  6787.  
  6788.  
  6789.  
  6790.  
  6791.           DialogPro v 2.1                                       Users Guide
  6792.                                                            Reference Manual
  6793.  
  6794.  
  6795.                db_ptr = create_db(argc[0],131112L,argc[0],131012L,1);
  6796.           
  6797.                /* display the dialog box */
  6798.                return(db_run(db_ptr,0));
  6799.           }
  6800.           
  6801.           
  6802.           and recompile (this should have no effect on the original
  6803.           executable size).  Then combine the files as indicate above, and
  6804.           run.  The three files can now be distributed as a single file,
  6805.           dbbound1.exe.
  6806.           
  6807.           
  6808.           F. Functions
  6809.           
  6810.           1. create_db
  6811.           
  6812.           a. Summary
  6813.           
  6814.           #include "dbpro.h"
  6815.           #include "dbpro.h"
  6816.           #include "dbbuild.h"
  6817.           #include "dbbuild.h"
  6818.           
  6819.           dialog_box *create_db(resource, roffset, index, ioffset, id)
  6820.                                 _____________________________________ 
  6821.           dialog_box *create_db(                                     )
  6822.                                 _____________________________________ 
  6823.           int resource;
  6824.               _________
  6825.           int          
  6826.               _________
  6827.           unsigned long roffset;
  6828.                         ________
  6829.           unsigned long         
  6830.                         ________
  6831.           int index;
  6832.               ______
  6833.           int       
  6834.               ______
  6835.           unsigned long ioffset;
  6836.                         ________
  6837.           unsigned long         
  6838.                         ________
  6839.           unsigned id;
  6840.                    ___
  6841.           unsigned    
  6842.                    ___
  6843.           
  6844.           
  6845.           b. Description
  6846.           
  6847.           The function create_db() create a dialog box from the resource
  6848.                        create_db                                        
  6849.           info contained in the file ( a file handle), resource, starting
  6850.                                                        ________          
  6851.           at the offset roffset in the file.  It uses the the index info
  6852.                         _______                                         
  6853.           contained in the file (a file handle), index, starting at the
  6854.                                                  _____                 
  6855.           offset, ioffset, to locate the particular dialog box to create,
  6856.                   _______                                                
  6857.           id.
  6858.           __ 
  6859.           
  6860.           
  6861.           c. Return Value
  6862.           
  6863.           Returns a NULL if it was unable to create the dialog box,
  6864.           otherwise returns a pointer to a dialog_box struct.
  6865.           
  6866.           
  6867.           2. destroy_db
  6868.           
  6869.           a. SUMMARY
  6870.           
  6871.           #include "dbpro.h"
  6872.           #include "dbpro.h"
  6873.           #include "dbbuild.h"
  6874.           #include "dbbuild.h"
  6875.           
  6876.           void destroy_db(db_ptr)
  6877.                           ______ 
  6878.           void destroy_db(      )
  6879.                           ______ 
  6880.  
  6881.  
  6882.  
  6883.                                        - 77 -
  6884.  
  6885.  
  6886.  
  6887.  
  6888.  
  6889.           DialogPro v 2.1                                       Users Guide
  6890.                                                            Reference Manual
  6891.  
  6892.  
  6893.           dialog_box db_ptr;
  6894.                      ______ 
  6895.           dialog_box       ;
  6896.                      ______ 
  6897.           
  6898.           
  6899.           b. Description
  6900.           
  6901.           The function destroy_db() frees the memory allocated to a dialog
  6902.                        destroy_db                                         
  6903.           box via a call to create_db().  With one exception. 
  6904.                             create_db                         
  6905.           free_form.response is not freed, as we assume that the dialog box
  6906.           responses are used in some manner for further processing.
  6907.           
  6908.           
  6909.           c. Return Value
  6910.           
  6911.           None.
  6912.           
  6913.           
  6914.           XII.  HypeIt!
  6915.           
  6916.           HypeIt! is a hypertext like help system.  Run the program
  6917.           hypeit.exe for further information on HypeIt!.
  6918.  
  6919.  
  6920.  
  6921.  
  6922.  
  6923.  
  6924.  
  6925.  
  6926.  
  6927.  
  6928.  
  6929.  
  6930.  
  6931.  
  6932.  
  6933.  
  6934.  
  6935.  
  6936.  
  6937.  
  6938.  
  6939.  
  6940.  
  6941.  
  6942.  
  6943.  
  6944.  
  6945.  
  6946.  
  6947.  
  6948.  
  6949.  
  6950.  
  6951.  
  6952.  
  6953.  
  6954.  
  6955.                                        - 78 -
  6956.  
  6957.  
  6958.  
  6959.  
  6960.  
  6961.  
  6962.  
  6963.  
  6964.  
  6965.           ----------------- The DialogPro registration form ---------------
  6966.           
  6967.           Mailing Address
  6968.           
  6969.           Name         :___________________________________________________
  6970.           Company Name :___________________________________________________
  6971.           Position     :___________________________________________________
  6972.           Street       :___________________________________________________
  6973.                         ___________________________________________________
  6974.           City         :_________________  State  :__  Zip Code :__________
  6975.           Country      :___________________________________________________
  6976.           Compuserve # :_________________  Phone # : ______________________
  6977.           
  6978.           
  6979.           Computer System
  6980.           
  6981.           Manufacturer :___________________________________________________
  6982.           Model        :___________________________________________________
  6983.           RAM          :___________________________________________________
  6984.           
  6985.           Disk Media   5 1/4" 360K __    5 1/4" 1.2mb __  
  6986.                        3 1/2" 720K __    3 1/2" 1.4mb __
  6987.           Hard Disk
  6988.             Capacity   :___________________________________________________
  6989.           Video Adapter:___________________________________________________
  6990.           Monitor      :___________________________________________________
  6991.           
  6992.           
  6993.           How did you hear about DialogPro? ______________________________
  6994.           _________________________________________________________________
  6995.           _________________________________________________________________
  6996.           _________________________________________________________________
  6997.           
  6998.           Desired Support Level (check one)
  6999.           
  7000.           __ $15,  The DialogPro shareware diskette
  7001.           __ $50,  registered DialogPro shareware library user
  7002.           __ $100, registered DialogPro source code user (non-commercial)
  7003.           __ $200, registered DialogPro source code user (commercial)
  7004.           
  7005.           Include a check for the amount corresponding to the desired level
  7006.           of service.  Make the check payable to, Seabreeze Software.
  7007.  
  7008.  
  7009.  
  7010.  
  7011.  
  7012.  
  7013.  
  7014.  
  7015.  
  7016.  
  7017.  
  7018.  
  7019.  
  7020.  
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.